• R/O
  • SSH
  • HTTPS

nina: Commit


Commit MetaInfo

Revision677 (tree)
Time2018-11-17 13:42:29
Authory-moriguchi

Log Message

generate Windows batch file (JavaScript)

Change Summary

Incremental Difference

--- nina/java/translator/net/morilib/nina/translate/AbstractNinaTranslator.java (revision 676)
+++ nina/java/translator/net/morilib/nina/translate/AbstractNinaTranslator.java (revision 677)
@@ -766,6 +766,8 @@
766766 q.isOptionDefined("ignoreCase") ? "t" : "");
767767 env.bind("SKIP_SPACES", q.getOptionNvl("whiteSpaces", " \\t\\n"));
768768 env.bind("SHEBANG", q.getOptionNvl("shebang", ""));
769+ env.bind("PUT_WINDOWS_BATCH", q.getOptionNvl("windowsBatchCommand", ""));
770+ env.bind("CR", "\r");
769771
770772 if("prompt".equals(q.getOption("main"))) {
771773 env.bind("PUTPROMPT", "true");
--- nina/java/translator/net/morilib/nina/translate/nina_template.dfa.js.sub1.sh (revision 676)
+++ nina/java/translator/net/morilib/nina/translate/nina_template.dfa.js.sub1.sh (revision 677)
@@ -1197,3 +1197,16 @@
11971197 }
11981198 EOF
11991199 [ -n "$USE_IMMEDIATE_FN" ] && echo '})();'
1200+
1201+#
1202+# print Windows batch file
1203+#
1204+if [ -n "$PUT_WINDOWS_BATCH" ]; then
1205+ batfile="/output/${OUTPUT_FILENAME}.bat"
1206+ cat -B > $batfile << EOF
1207+@ECHO OFF${CR}
1208+SETLOCAL${CR}
1209+SET SDIR=%~dp0${CR}
1210+${PUT_WINDOWS_BATCH} %SDIR%${OUTPUT_FILENAME}.js %*${CR}
1211+EOF
1212+fi
Show on old repository browser