Files
Nim/bootstrap.sh
Adam Strzelecki 6cc9853935 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.
2015-10-03 19:51:17 +02:00

23 lines
321 B
Bash
Executable File

#!/bin/sh
set -e
set -x
if [ ! -e csources/.git ]; then
git clone --depth 1 git://github.com/nim-lang/csources.git csources
fi
cd "csources"
sh build.sh
cd ".."
./bin/nim c koch
./koch boot -d:release
./koch geninstall
set +x
echo
echo 'Install Nim using "./install.sh <dir>" or "sudo ./install.sh <dir>".'
exit 0