Skip to content

Commit

Permalink
Add comment to bash fck
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkbeforecoding committed Dec 3, 2016
1 parent 2d8ee6a commit 423c103
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fck
@@ -1,26 +1,34 @@
#!/usr/bin/env bash

fckpath=$(readlink -f "$0")

#the fck tool path
fckpath=$(readlink -f "$0")
#this fck tool dir
dir=$(dirname $fckpath)
script="$dir/fck-cmd/fck-$1.fsx"
shell="$dir/fck-cmd/fck-$1.sh"
cmd="$1"
shift

#restore packages if needed
if [ ! -d "$dir/fck-cmd/packages" ]
then
pushd "$dir/fck-cmd" > /dev/null
mono "$dir/fck-cmd/.paket/paket.bootstrapper.exe" --run restore
popd > /dev/null
fi

#execute script command if it exists
if [ -e $script ]
then
mono "$dir/fck-cmd/packages/FAKE/tools/FAKE.exe" "$script" -- $@

#execute shell command if it exists
elif [ -e $shell ]
then
eval $shell $@

#show help
else
pushd "$dir/fck-cmd" > /dev/null
mono "$dir/fck-cmd/packages/FAKE/tools/FAKE.exe" "$dir/fck-cmd/fck-help.fsx" -- $cmd $@
Expand Down

0 comments on commit 423c103

Please sign in to comment.