Skip to content

Commit

Permalink
BUGFIX : Make error reporting more sensible.
Browse files Browse the repository at this point in the history
  • Loading branch information
crdoconnor committed Dec 17, 2020
1 parent 2b6ef0e commit 97f99e8
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions hk.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN adduser root sudo && apt-get install -y sudo
RUN apt-get update && apt-get upgrade -y && apt-get install \
python-setuptools build-essential python3-pip \
virtualenv python3 inetutils-ping git \
golang-go wget curl libssl-dev zlib1g-dev libbz2-dev \
wget curl libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev -y
Expand Down Expand Up @@ -107,7 +107,7 @@ func run_command(command string, arguments []string) {
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
die("Error running command")
die("Error running command: " + command + " " + strings.Join(arguments, " "))
}
}

Expand Down Expand Up @@ -225,13 +225,24 @@ func clean(projectpath string) {
os.Exit(0)
}

func mountdir(projectdir string) string {
override_mountdir := os.Getenv("MOUNTDIR")
chosendir := projectdir

if override_mountdir != "" {
chosendir = override_mountdir
}

return chosendir
}

func dockerrun(projectdir string, hitchcode string, arguments []string) {
run_command(
docker(),
append(
[]string{
"run", "--rm", "-v",
projectdir + ":/home/hitch/project",
mountdir(projectdir) + ":/home/hitch/project",
"--mount",
"type=volume,source=hitchv-" + hitchcode + ",destination=/gen",
"hitch-" + hitchcode,
Expand Down Expand Up @@ -320,7 +331,7 @@ func execute() {
docker_arguments := append(
[]string{
"run", "--rm", "-it", "-v",
projectdir + ":/home/hitch/project",
mountdir(projectdir) + ":/home/hitch/project",
"--network", "host",
"--mount",
"type=volume,source=hitchv-" + hitchcode + ",destination=/gen",
Expand Down

0 comments on commit 97f99e8

Please sign in to comment.