Skip to content

Commit e4f3b8d

Browse files
committed
fix(update-notifier): add global flag and update dev task
1 parent 171dd0d commit e4f3b8d

File tree

6 files changed

+357
-249
lines changed

6 files changed

+357
-249
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ yarn.lock
1212
.vscode/*
1313
!.vscode/extensions.json
1414
!.vscode/settings.json
15+
!.vscode/launch.json
1516
.idea
1617
*.swp
1718
*.swo

.vscode/launch.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"type": "node",
10+
"request": "launch",
11+
"name": "Launch Program",
12+
"program": "${workspaceFolder}/dist/cli.js"
13+
},
14+
{
15+
"type": "node",
16+
"request": "launch",
17+
"name": "Jest All",
18+
"program": "${workspaceFolder}/node_modules/.bin/jest",
19+
"args": ["--runInBand"],
20+
"console": "integratedTerminal",
21+
"internalConsoleOptions": "neverOpen",
22+
"disableOptimisticBPs": true,
23+
"windows": {
24+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
25+
}
26+
},
27+
{
28+
"type": "node",
29+
"request": "launch",
30+
"name": "Jest Current File",
31+
"program": "${workspaceFolder}/node_modules/.bin/jest",
32+
"args": [
33+
"${fileBasenameNoExtension}",
34+
"--config",
35+
"jest.config.js"
36+
],
37+
"console": "integratedTerminal",
38+
"internalConsoleOptions": "neverOpen",
39+
"disableOptimisticBPs": true,
40+
"windows": {
41+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
42+
}
43+
}
44+
]
45+
}

cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'use strict';
44
import * as program from 'commander';
55
// START SNAPCRAFT IGNORE
6-
import * as updateNotifier from 'update-notifier';
6+
import { UpdateNotifier } from 'update-notifier';
77
// END SNAPCRAFT IGNORE
88
const pkg = require('./package.json');
99
import { Taskline } from './src/taskline';
@@ -199,9 +199,9 @@ program.on('command:*', function() {
199199
});
200200

201201
// START SNAPCRAFT IGNORE disable this for snap
202-
updateNotifier({
203-
pkg
204-
}).notify();
202+
new UpdateNotifier({
203+
pkg,
204+
}).notify({ isGlobal: true });
205205
// END SNAPCRAFT IGNORE
206206

207207
program.parse(process.argv);

gulpfile.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,25 @@ const compileTest = () => {
5050
.pipe(gulp.dest(dirs.dist));
5151
};
5252

53+
const watch = () => {
54+
gulp.watch(['src/**/*.ts', 'cli.ts', 'i18n/**/*.json'], buildTest);
55+
}
56+
5357
const delDist = () => {
5458
return del(['dist/**/*']);
5559
}
5660

5761
const build = gulp.series(delDist, compileProd, moveLocals);
5862
const buildMeta = gulp.parallel(movePackage, moveReadme);
59-
const snapcraft = gulp.series(compileProd, editPackageSnapcraft)
63+
const buildTest = gulp.series(compileTest, moveLocals);
64+
const dev = gulp.series(buildTest, watch);
65+
const snapcraft = gulp.series(compileProd, editPackageSnapcraft);
6066

6167
module.exports = {
6268
build,
6369
buildMeta,
70+
buildTest,
71+
dev,
6472
snapcraft,
6573
default: build
6674
};
67-
68-
gulp.task('watch', gulp.series(function() {
69-
gulp.watch(['src/**/*.ts', 'cli.ts'], gulp.series(compileTest, moveLocals));
70-
}));

0 commit comments

Comments
 (0)