Skip to content

Commit ac8e5ff

Browse files
authored
build(deps): bump tfx-cli version (#471)
1 parent aa7ba83 commit ac8e5ff

File tree

3 files changed

+251
-940
lines changed

3 files changed

+251
-940
lines changed

build-scripts/packageExtension.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import fs = require('fs-extra')
99
import path = require('path')
1010
import shell = require('shelljs')
1111
import folders = require('./scriptUtils')
12+
import os = require('os')
1213

1314
const timeMessage = 'Packaged extension'
1415
const manifestFile = 'vss-extension.json'
@@ -132,16 +133,21 @@ function packagePlugin(options: CommandLineOptions) {
132133
})
133134

134135
console.log('Creating deployment vsix')
135-
let tfxcmd = `tfx extension create --root ${folders.packageRoot} --output-path ${
136-
folders.packageRoot
137-
} --manifests ${path.join(folders.packageRoot, manifestFile)}`
136+
137+
const binName = os.platform() === 'win32' ? `tfx.cmd` : 'tfx'
138+
const tfx = path.join(process.cwd(), 'node_modules', '.bin', binName)
139+
const args: string[] = ['extension', 'create', '--root', folders.packageRoot]
140+
141+
args.push('--output-path', folders.packageRoot)
142+
args.push('--manifests', path.join(folders.packageRoot, manifestFile))
143+
138144
if (options.publisher) {
139-
tfxcmd += ' --publisher ' + options.publisher
145+
args.push('--publisher', options.publisher)
140146
}
141147

142-
console.log('Packaging with:' + tfxcmd)
148+
console.log('Packaging with:' + `${tfx} ${args.join(' ')}`)
143149

144-
ncp.execSync(tfxcmd, { stdio: 'pipe' })
150+
ncp.execFileSync(tfx, args, { stdio: 'pipe' })
145151

146152
console.log('Packaging successful')
147153
}

0 commit comments

Comments
 (0)