Question about DITA launcher inside a Cygwin environment #Oxygen
I'm trying to create a workflow that starts with multiple DITA files inside oXygen that end up as a single md file in GitHub.
I have installed the GitHub plugin (built on on the JGit library) in oXygen so that I can commit to a GitHub repository.
When I make the commit, I am trying to make a DITA-OT call using pre-commit githooks. The githooks script calls DITA-OT and uses it to merge the files before submitting them as a single file.
Unfortunately, this is not working.
The script (see below) works as expected when run from a GitBash or Windows command window. But running it from within oXygen appears to ignore the githooks.
Environment: Windows 10, Cygwin 3.0.7-1, DITA-OT 3.4, Java 11+28.
#!/bin/sh set -x # In order to run this pre-commit hook the user will need the following setup # 1. The DITA-OT command utility needs to be added to the path # In Windows, typically this path is: "C:\DEV\DITA-OT\dita-ot-3.4\bin" # 2. Git needs to be installed on your computer. (https://git-scm.com/download/) # 3. Run 'git config core.hooksPath .githooks' in the repo folder to add the Git symlink. # There is no confirmation. # 3. Run 'chmod +x .githooks/pre-commit' in the repo folder to add the Git symlink. # There is no confirmation. # Populate all the .DITA* files for this commit ditafiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.dita*') # Get the absolute path of the `.git/hooks` directory export GIT_HOOKS=`cd "\`dirname "\\\`readlink "$0" || echo $0\\\`"\`" && pwd` # Loop over the files, find their directory, and generate the README within that directory for arg in $ditafiles; do BASE_DIRECTORY=$(echo "$arg" | cut -d "/" -f1) # Set the absolute path of the build directory export BUILD_FILES="$GIT_HOOKS/../$BASE_DIRECTORY" # Now that we have the base path to the project we can run the DITA command to generate that specific README dita --input=$BUILD_FILES/README.ditamap --format=markdown -Dchunk=to-content --output=$BUILD_FILES/docs/ done # Exit with status of last command exit 0
The JAVA_HOME variable user path (not system path, if that makes a difference) points to jdk-11.
Running the following in a Git Bash window works.
As this is basically the commands generated from the other code sample above, I'm stumped, as is the support person at oXygen.
The following is the response I got from the oXygen support person:
CODE: SELECT ALL
Is this true, or are there other settings that need to be made?
I'd expect that since you are using windows, git, when run from oxygen, has no knowledge of your cygwin environment and thus cannot launch your script with bash.toggle quoted messageShow quoted text
I'd guess that you'd need to give the file an extension, like .sh, then associate the .sh mimetype with bash.
On January 10, 2020 7:51:46 AM PST, Grant Hogarth <grant.hogarth@...> wrote: