Skip to Main Content

SQLcl

sql /nolog doesn't work with GitBash on Windows

jgebalApr 25 2019 — edited Apr 27 2019

When running "sql /nolog" from GitBash (on Windows x64) I get the following error:
Bad Option: C:/Program Files/Git/nolog                                                                               

Oracle SQL Developer Command-Line (SQLcl) help                                                                       

Usage 1: sql -H | -V

...

I'd like to use sql /nolog to format my changed project files as part of pre-commit hook in GIT.

Since git pre-commit hooks are Unix/Linux scripts, the sql is getting invoked from GitBash on windows.

GitBash is a Unix shell emulator in Windows.

There seems to be an issue with the "/nolog" option as it is getting misinterpreted (probably somewhere in Java?)

What can I do to make the "/nolog" option work for me in SQLCL from GitBash on Windows?

I've already changed the "sql" script to extend the CYGWIN check:

was:

  case `uname` in

    CYGWIN*) cygwin=true;;

  esac

is:

  case `uname` in

    CYGWIN*) cygwin=true;;

    MINGW64_NT-6.1*) cygwin=true;;

  esac

sqlcl 19.1.

Windows 7 pro x64

Git for Windows version 2.20.1 (https://git-scm.com/downloads )

java version "1.8.0_201"

Java(TM) SE Runtime Environment (build 1.8.0_201-b09)

This post has been answered by Gaz in Oz on Apr 27 2019
Jump to Answer
Comments
Post Details
Added on Apr 25 2019
11 comments
1,127 views