Skip to content

Commit

Permalink
Merge 701541f into 46aaf26
Browse files Browse the repository at this point in the history
  • Loading branch information
ikobe authored Jun 14, 2017
2 parents 46aaf26 + 701541f commit 42d23ec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ $ atool-build -h
--devtool <devtool> sourcemap generate method, default is null
--config <path> custom config path, default is webpack.config.js
--no-compress build without compress
--silent build without notify
```

### 配置扩展
Expand Down
5 changes: 3 additions & 2 deletions bin/atool-build
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ program
.option('--publicPath <publicPath>', 'publicPath for webpack')
.option('--devtool <devtool>', 'sourcemap generate method, default is null')
.option('--config <path>', 'custom config path, default is webpack.config.js')
.option('--no-compress','build without compress')
.option('--json','running webpack with --json, ex. result.json')
.option('--no-compress', 'build without compress')
.option('--silent', 'close notifier')
.option('--json', 'running webpack with --json, ex. result.json')
.option('--verbose', 'run with more logging messages.')
.parse(process.argv);

Expand Down
16 changes: 9 additions & 7 deletions src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ export default function build(args, callback) {
console.error(buildInfo);
} else {
console.log(buildInfo);
notifier.notify({
title: 'ant tool',
message: 'done',
subtitle: 'build successfully',
contentImage: join(__dirname, '../assets/success.png'),
sound: 'Glass',
});
if (args.silent !== true) {
notifier.notify({
title: 'ant tool',
message: 'done',
subtitle: 'build successfully',
contentImage: join(__dirname, '../assets/success.png'),
sound: 'Glass',
});
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions test/build-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,7 @@ describe('lib/build', function () {
expect(err.message).toEqual('no webpack entry found');
});
});
it('should support silent', () => {
return testBuild({ hash: true, silent: true }, 'build-normal');
});
});

0 comments on commit 42d23ec

Please sign in to comment.