codeguru-il / corewars8086

Core Wars for standard 8086 assembly.
Apache License 2.0
31 stars 19 forks source link

Broken cgx.sh #22

Open maroshi opened 6 years ago

maroshi commented 6 years ago

cgx.sh has 3 issues.

  1. Incorrect cgx directory version 4.0.1, should be 4.0.2
  2. The cgx version is hardcoded into the script
  3. Implicit script requirement to be invoked from cgx directory

This is a purposed solution to the above issues 1,2 and 3:

#!/bin/bash

# get the cgx script dir
cgxDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# activate cgx from its home dir
cd $cgxDIR
cgxJarFile=$(realpath $(find . -name corewars*.jar))
java -cp $cgxJarFile il.co.codeguru.corewars8086.CoreWarsEngine

Strongly suggest same treatment to cgx.bat I could submit a pull requerst, but the deployment files are not included in the project code.