File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2+ const chalk = require ( "chalk" ) ;
3+
4+ const USAGE_MSG = `Usage: create-webextension project_dir_name` ;
5+
6+ if ( ! process . argv [ 2 ] ) {
7+ console . error ( `${ chalk . red ( "Missing project dir name." ) } \n` ) ;
8+ console . log ( USAGE_MSG ) ;
9+ process . exit ( 1 ) ;
10+ }
211
312require ( ".." ) . main ( process . argv [ 2 ] ) ;
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ const chalk = require("chalk");
55const fs = require ( "mz/fs" ) ;
66const stripAnsi = require ( "strip-ansi" ) ;
77
8- const USAGE_MSG = `Usage: create-webextension project_dir_name` ;
9-
108const README = `
119This project contains a blank WebExtension addon, a "white canvas" for your new experiment of
1210extending and remixing the Web.
@@ -89,9 +87,7 @@ function getProjectManifest(projectDirName) {
8987
9088exports . main = function main ( dirPath ) {
9189 if ( ! dirPath ) {
92- console . error ( `${ chalk . red ( "Missing project dir name." ) } \n` ) ;
93- console . log ( USAGE_MSG ) ;
94- process . exit ( 1 ) ;
90+ throw new Error ( "Project directory name is a compulsory argument" ) ;
9591 }
9692
9793 const projectPath = path . resolve ( dirPath ) ;
You can’t perform that action at this time.
0 commit comments