File tree Expand file tree Collapse file tree 1 file changed +24
-14
lines changed
Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,27 @@ var commands = require( './commands.json' );
1515
1616// FUNCTIONS //
1717
18+ /**
19+ * Performs initialization tasks.
20+ *
21+ * @private
22+ * @example
23+ * init();
24+ */
25+ function init ( ) {
26+ var opts ;
27+
28+ // Check if newer versions exist for this package:
29+ opts = {
30+ 'pkg' : pkg
31+ } ;
32+ notifier ( opts ) . notify ( ) ;
33+
34+ // Set the process title to allow the process to be more easily identified:
35+ process . title = pkg . name ;
36+ process . stdout . on ( 'error' , process . exit ) ;
37+ } // end FUNCTION init()
38+
1839/**
1940* Prints usage information.
2041*
@@ -69,29 +90,18 @@ var cmd;
6990var i ;
7091
7192
72- // INIT //
73-
74- process . title = pkg . name ;
75- process . stdout . on ( 'error' , process . exit ) ;
76-
77-
78- // PACKAGE UPDATES //
79-
80- notifier ( { 'pkg' : pkg } ) . notify ( ) ;
81-
93+ // MAIN //
8294
83- // ARGUMENTS //
95+ init ( ) ;
8496
97+ // Parse command-line arguments:
8598args1 = parseArgs ( process . argv . slice ( 2 ) , opts ) ;
8699
87100if ( args1 . version ) {
88101 return version ( ) ;
89102}
90103cmd = args1 . _ [ 0 ] ;
91104
92-
93- // MAIN //
94-
95105opts = {
96106 'cwd' : process . cwd ( ) ,
97107 'env' : process . env ,
You can’t perform that action at this time.
0 commit comments