Skip to content

Commit

Permalink
misc vcpkg updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed May 18, 2022
1 parent 99dbd8c commit 77cab63
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
17 changes: 16 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,15 +646,30 @@ const run = async () => {
}

if (vcpkg !== '') {
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')

// Update vcpkg
const cwd = process.cwd()
process.chdir(vcpkgRoot)
execSync('git pull -q')
execSync('bootstrap-vcpkg.bat')

// install packages
msSt = grpSt(`vcpkg --triplet x64-windows install ${vcpkg}`)
execSync(`vcpkg --triplet x64-windows install ${vcpkg}`)
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')

// add vcpkg dll folder to path
const vcpkgBin = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\bin`
core.addPath(vcpkgBin)
console.log(`Added to Path: ${vcpkgBin}`)

core.exportVariable('OPT_DIR', `--with-opt-dir=${vcpkgRoot}/installed/x64-windows`)
const vcpkgTools = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\tools`
if (fs.existsSync(vcpkgTools) && fs.readdirSync(vcpkgTools).length >= 0) {
core.addPath(vcpkgTools)
console.log(`Added to Path: ${vcpkgTools}`)
}
process.chdir(cwd)
grpEnd(msSt)
}
} catch (error) {
Expand Down
17 changes: 16 additions & 1 deletion mswin.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,30 @@ export const run = async () => {
}

if (vcpkg !== '') {
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')

// Update vcpkg
const cwd = process.cwd()
process.chdir(vcpkgRoot)
execSync('git pull -q')
execSync('bootstrap-vcpkg.bat')

// install packages
msSt = grpSt(`vcpkg --triplet x64-windows install ${vcpkg}`)
execSync(`vcpkg --triplet x64-windows install ${vcpkg}`)
const vcpkgRoot = process.env.VCPKG_INSTALLATION_ROOT.replace(/\\/g, '/')

// add vcpkg dll folder to path
const vcpkgBin = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\bin`
core.addPath(vcpkgBin)
console.log(`Added to Path: ${vcpkgBin}`)

core.exportVariable('OPT_DIR', `--with-opt-dir=${vcpkgRoot}/installed/x64-windows`)
const vcpkgTools = `${process.env.VCPKG_INSTALLATION_ROOT}\\installed\\x64-windows\\tools`
if (fs.existsSync(vcpkgTools) && fs.readdirSync(vcpkgTools).length >= 0) {
core.addPath(vcpkgTools)
console.log(`Added to Path: ${vcpkgTools}`)
}
process.chdir(cwd)
grpEnd(msSt)
}
} catch (error) {
Expand Down

0 comments on commit 77cab63

Please sign in to comment.