File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/env/node
2
2
3
+ // NOTE: You cannot (typically) run this file directly in Windows.
4
+ // For Windows, you may need to pass this file to node.exe
5
+ // See 'doco_win.bat' for scripting ideas for Windows.
6
+
3
7
var path = require ( "path" ) ,
4
8
fs = require ( "fs" ) ,
5
9
ascli = require ( "ascli" ) ,
@@ -9,6 +13,10 @@ var path = require("path"),
9
13
argv = ascli . argv ,
10
14
pkg = require ( "../package.json" ) ;
11
15
16
+ // Workaround issue based on luileito's report
17
+ // https://github.com/dcodeIO/doco/issues/2
18
+ if ( opt == undefined ) opt = app . opt ;
19
+ if ( argv == undefined ) argv = app . argv ;
12
20
13
21
if ( argv . length < 1 ) {
14
22
ascli . banner ( "doco" . green . bold , pkg . version ) ;
Original file line number Diff line number Diff line change
1
+
2
+ @ echo off
3
+
4
+ REM Just a quick example of how one might use within Windows
5
+ REM ( There is another example at https://github.com/dcodeIO/doco/issues/1 )
6
+ REM You can use this info to create a BAT for your individual needs (or use as-is).
7
+
8
+ REM .\bin\doco cannot be run directly in Windows (it doesn't know #! lines)
9
+ REM .\bin\doco must be passed to node.exe directly
10
+
11
+ REM This BAT file example assumes:
12
+ REM 1. node.exe is available through the PATH
13
+ REM 2. This BAT is in the root of the doco module's folder
14
+ REM 3. You just want to do markdown on one file
15
+
16
+ echo Usage: " doco_win.bat Filename-without-ext"
17
+ echo (.js and .md added automatically to name for input and output)
18
+
19
+ if " %1 " == " " goto blank
20
+
21
+ node %~dp0 bin\doco --gen=markdown %1 .js > %1 .md
22
+ REM '%~dp0' is the path to this BAT file, '%1' is the first arg after bat file itself, '%*' would be all args
23
+ REM You could just pass all the arguments through using:
24
+ REM node %~dp0bin\doco %*
25
+ REM Or if you want to put a BAT in a folder where doco is installed as dependency
26
+ REM node %~dp0node_modules\doco\bin\doco %*
27
+ GOTO DONE
28
+
29
+ :BLANK
30
+ echo !! You must enter a file name (omitting .js) ! !
31
+
32
+ :DONE
You can’t perform that action at this time.
0 commit comments