Skip to content

Commit 83b52ff

Browse files
authored
Merge pull request #2241 from akshita31/retain_vsix_online
Retain the vsixes
2 parents ac5774a + 9831d04 commit 83b52ff

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

tasks/commandLineArguments.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
import * as minimist from 'minimist';
99
import * as path from 'path';
1010

11-
let argv = minimist(process.argv.slice(2));
11+
let argv = minimist(process.argv.slice(2), {
12+
boolean: ['retainVsix']
13+
});
1214

13-
export const commandLineOptions ={
14-
outputFolder: makePathAbsolute(argv['o']),
15+
export const commandLineOptions = {
16+
retainVsix: !!argv['retainVsix'],
17+
outputFolder: makePathAbsolute(argv['o']),
1518
codeExtensionPath: makePathAbsolute(argv['codeExtensionPath'])
1619
};
1720

tasks/offlinePackagingTasks.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { PlatformInformation } from '../src/platform';
2222
import { DownloadAndInstallPackages } from '../src/packageManager/PackageManager';
2323
import NetworkSettings from '../src/NetworkSettings';
2424
import { GetRunTimeDependenciesPackages } from '../src/CSharpExtDownloader';
25+
import { commandLineOptions } from '../tasks/commandLineArguments';
2526

2627
gulp.task('vsix:offline:package', async () => {
2728
del.sync(vscodeignorePath);
@@ -37,7 +38,14 @@ gulp.task('vsix:offline:package', async () => {
3738
});
3839

3940
async function doPackageOffline() {
40-
cleanSync(true);
41+
if (commandLineOptions.retainVsix) {
42+
//if user doesnot want to clean up the existing vsix packages
43+
cleanSync(false);
44+
}
45+
else {
46+
cleanSync(true);
47+
}
48+
4149
util.setExtensionPath(codeExtensionPath);
4250
const packageJSON = getPackageJSON();
4351
const name = packageJSON.name;

test/releaseTests/offlinePackage.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ suite("Offline packaging of VSIX", function () {
2121
let args: string[] = [];
2222
args.push(path.join("node_modules", "gulp", "bin", "gulp.js"));
2323
args.push("package:offline");
24+
args.push("--retainVsix");// do not delete the existing vsix in the repo
2425
args.push(`-o`);
2526
args.push(tmpDir.name);
2627
invokeNode(args);

0 commit comments

Comments
 (0)