bootstrap: Generate final install.sh during build

This solves problem where bootstrap was simply copying ./install.sh.template
into ./install.sh. Then first call of ./install.sh was calling ./koch install
that was running extra compilation and overwriting ./install.sh with new
content.

This was overcomplicated, and also caused first `sudo ./install.sh DIR` to run
compilation under root account, leaving root owned files in working directory.

Now bootstrap calls `./koch geninstall` that just generates ./install.sh
without calling it. This ./install.sh is FINAL one, and running it does not
generate any files aside passed DIR. This makes whole process simpler.
This commit is contained in:
Adam Strzelecki
2015-10-01 00:18:32 +02:00
parent 6655537c66
commit 6cc9853935
2 changed files with 5 additions and 11 deletions

View File

@@ -12,8 +12,11 @@ cd ".."
./bin/nim c koch
./koch boot -d:release
./koch geninstall
cp -f install.sh.template install.sh
chmod +x install.sh
set +x
echo
echo 'Install Nim using "./install.sh <dir>" or "sudo ./install.sh <dir>".'
exit 0

View File

@@ -1,9 +0,0 @@
#!/bin/sh
set -e
set -x
if [ "$1" != "" ]; then
exec ./koch install "$1"
else
exec ./koch install
fi