Skip to content

Commit cdf0656

Browse files
committed
show notification for every hour
1 parent 0f08990 commit cdf0656

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/usr/bin/env node
22
const updateNotifier = require('update-notifier');
33
const pkg = require('./package.json');
4-
updateNotifier({pkg}).notify();
4+
updateNotifier({
5+
pkg: pkg,
6+
updateCheckInterval : 60 * 60 * 1000
7+
}).notify({
8+
defer: false
9+
});
510
const {
611
build
712
} = require('./src/command');

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wavemaker/wm-cordova-cli",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "command line tool to easily build a wavemaker mobile project",
55
"main": "index.js",
66
"preferGlobal": true,

src/command.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ async function setupBuildDirectory(src, dest) {
2323
const target = dest;
2424
if (fs.existsSync(target)) {
2525
if (fs.readdirSync(target).length) {
26-
const response = await showConfirmation('Would you like to empty the dest folder (i.e. ' + dest + ') ?');
26+
const response = await showConfirmation('Would you like to empty the dest folder (i.e. ' + dest + ') (yes/no) ?');
2727
if (response !== 'y' && response !== 'yes') {
28-
return false;
28+
process.exit();
2929
}
30-
fs.removeSync(target);
30+
fs.unlinkSync(target);
3131
}
3232
}
3333
fs.mkdirsSync(target);
@@ -144,7 +144,16 @@ module.exports = {
144144
])
145145
}
146146
args.src = path.resolve(args.src) + '/';
147-
args.dest = path.resolve(args.dest || (await getDefaultDestination(args.src, args.platform))) + '/';
147+
if(!args.dest) {
148+
args.dest = await getDefaultDestination(args.src, args.platform);
149+
}
150+
args.dest = path.resolve(args.dest) + '/';
151+
if(args.src === args.dest) {
152+
logger.error({
153+
label: loggerLabel,
154+
message: 'source and destination folders are same. Please choose a different destination.'
155+
});
156+
}
148157
logger.info({
149158
label: loggerLabel,
150159
message: `Building at : ${args.dest}`

0 commit comments

Comments
 (0)