Skip to content

Commit 77cab63

Browse files
committed
misc vcpkg updates
1 parent 99dbd8c commit 77cab63

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

dist/index.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,15 +646,30 @@ const run = async () => {
646646
}
647647

648648
if (vcpkg !== '') {
649+
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')
650+
651+
// Update vcpkg
652+
const cwd = process.cwd()
653+
process.chdir(vcpkgRoot)
654+
execSync('git pull -q')
655+
execSync('bootstrap-vcpkg.bat')
656+
657+
// install packages
649658
msSt = grpSt(`vcpkg --triplet x64-windows install ${vcpkg}`)
650659
execSync(`vcpkg --triplet x64-windows install ${vcpkg}`)
651-
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')
660+
661+
// add vcpkg dll folder to path
662+
const vcpkgBin = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\bin`
663+
core.addPath(vcpkgBin)
664+
console.log(`Added to Path: ${vcpkgBin}`)
665+
652666
core.exportVariable('OPT_DIR', `--with-opt-dir=${vcpkgRoot}/installed/x64-windows`)
653667
const vcpkgTools = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\tools`
654668
if (fs.existsSync(vcpkgTools) && fs.readdirSync(vcpkgTools).length >= 0) {
655669
core.addPath(vcpkgTools)
656670
console.log(`Added to Path: ${vcpkgTools}`)
657671
}
672+
process.chdir(cwd)
658673
grpEnd(msSt)
659674
}
660675
} catch (error) {

mswin.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,30 @@ export const run = async () => {
5151
}
5252

5353
if (vcpkg !== '') {
54+
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')
55+
56+
// Update vcpkg
57+
const cwd = process.cwd()
58+
process.chdir(vcpkgRoot)
59+
execSync('git pull -q')
60+
execSync('bootstrap-vcpkg.bat')
61+
62+
// install packages
5463
msSt = grpSt(`vcpkg --triplet x64-windows install ${vcpkg}`)
5564
execSync(`vcpkg --triplet x64-windows install ${vcpkg}`)
56-
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')
65+
66+
// add vcpkg dll folder to path
67+
const vcpkgBin = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\bin`
68+
core.addPath(vcpkgBin)
69+
console.log(`Added to Path: ${vcpkgBin}`)
70+
5771
core.exportVariable('OPT_DIR', `--with-opt-dir=${vcpkgRoot}/installed/x64-windows`)
5872
const vcpkgTools = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\tools`
5973
if (fs.existsSync(vcpkgTools) && fs.readdirSync(vcpkgTools).length >= 0) {
6074
core.addPath(vcpkgTools)
6175
console.log(`Added to Path: ${vcpkgTools}`)
6276
}
77+
process.chdir(cwd)
6378
grpEnd(msSt)
6479
}
6580
} catch (error) {

0 commit comments

Comments
 (0)