aboutsummaryrefslogtreecommitdiff
path: root/bin/install.sh
diff options
context:
space:
mode:
authorJakob Stendahl <14180120+JakobST1n@users.noreply.github.com>2018-12-01 00:28:28 +0100
committerGitHub <noreply@github.com>2018-12-01 00:28:28 +0100
commit19df9946b438b38b9a4f3f57ad002981a1ae1eaf (patch)
treee8eb839a305502584e31e1b1a96c70406b9b6255 /bin/install.sh
parentfd7a1b51126f8b8f889807cb7d56bb3626a0e0b5 (diff)
parent7ec685de6e441af1f614bb9d18e25c047d21466b (diff)
downloadLuxcena-Neo-19df9946b438b38b9a4f3f57ad002981a1ae1eaf.tar.gz
Luxcena-Neo-19df9946b438b38b9a4f3f57ad002981a1ae1eaf.zip
Merge pull request #6 from JakobST1n/dev
Written docs, finished CLI
Diffstat (limited to 'bin/install.sh')
-rwxr-xr-xbin/install.sh27
1 files changed, 18 insertions, 9 deletions
diff --git a/bin/install.sh b/bin/install.sh
index 2ccb7e0..cd4f07b 100755
--- a/bin/install.sh
+++ b/bin/install.sh
@@ -111,19 +111,19 @@ tput setaf 8
printf '%s\n' " - Making app-dir (/bin/luxcena-neo)..."
tput sgr0
userDir=$(eval echo "~$username")
-mkdir -p "$userDir/install" &>> $LOG || die
-chown $username:$username "$userDir/install" &>> $LOG || die
-mkdir -p "$userDir/install/src" &>> $LOG || die
-chown $username:$username "$userDir/install/src" &>> $LOG || die
-mkdir -p "$userDir/install/userdata" &>> $LOG || die
-chown $username:$username "$userDir/install/userdata" &>> $LOG || die
+#mkdir -p "$userDir/install" &>> $LOG || die
+#chown $username:$username "$userDir/install" &>> $LOG || die
+mkdir -p "$userDir/src" &>> $LOG || die
+chown $username:$username "$userDir/src" &>> $LOG || die
+mkdir -p "$userDir/userdata" &>> $LOG || die
+chown $username:$username "$userDir/userdata" &>> $LOG || die
# Third we copy the source into the correct swap-folder
tput setaf 8
printf '%s\n' " - Copying sourceCode to app-dir..."
tput sgr0
-cp -r . "$userDir/install/src" &>> $LOG || die
-chown -R $username:$username "$userDir/install/src" &>> $LOG || die
+cp -r . "$userDir/src" &>> $LOG || die
+chown -R $username:$username "$userDir/src" &>> $LOG || die
# fourth we run npm i
tput setaf 8
@@ -131,7 +131,15 @@ printf '%s\n' " - Running npm i..."
tput sgr0
tput sc
export NODE_ENV=production &>> $LOG || die
-runuser -l $username -c 'npm --prefix ~/install/src install ~/install/src --only=production' &>> $LOG || die # This is probably a bit overkill to have --only=... but better safe than sorry?
+runuser -l $username -c 'npm --prefix ~/src install ~/src --only=production' &>> $LOG || die # This is probably a bit overkill to have --only=... but better safe than sorry?
+tput rc; tput ed
+
+# fourth we copy the cli to our bin folder
+tput setaf 8
+printf '%s\n' " - Adding cli-script..."
+tput sgr0
+cp bin/luxcena-neo-cli.sh /usr/bin/luxcena-neo-cli.sh &>> $LOG || die
+ln -sf /usr/bin/luxcena-neo-cli.sh /usr/bin/lux-neo &>> $LOG || die
tput rc; tput ed
# Fifth we add the service files
@@ -143,3 +151,4 @@ systemctl daemon-reload &>> $LOG || die
# Installation is done!
printf '\n\e[5m%s\e[0m\n' "🎉Luxcena-Neo is now installed🎉"
+printf 'You can now delete this folder'