Skip to content

Commit

Permalink
finished installer scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
vision-05 committed Jun 20, 2021
1 parent 4b969f6 commit 7698b69
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 29 deletions.
29 changes: 0 additions & 29 deletions bettercode.sh

This file was deleted.

1 change: 1 addition & 0 deletions bettercode/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[manifold "0.1.9-alpha4"]
[me.raynes/fs "1.4.6"]
[org.openjfx/javafx-base "15.0.1"]
[org.openjfx/javafx-graphics "15.0.1"]
[org.fxmisc.richtext/richtextfx "0.10.6"]]
:main ^:skip-aot bettercode.core
:target-path "target/%s"
Expand Down
92 changes: 92 additions & 0 deletions scripts/bettercode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/sh
checkDeps() {

}

checkBetterCode() {

}

installDeps() {
mkdir "$HOME/bin"
curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > "$HOME/bin/lein"
chmod a+x "$HOME/bin/lein"
lein
}


install() {
echo "Running installer"
mkdir "$HOME/.bc"
cd "$HOME/.bc"
curl -s https://api.github.com/repos/vision-05/betterCode/releases/latest | grep "browser_download_url.*tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi -
tar -xvf bettercode.tar.gz #this archive is in the release with installer
}

clean() {
echo "Cleaning current install"
cd "$HOME/.bc"
rm -rf bettercode
rm bettercode.tar.gz
}

update() {
clean
install
}

uninstall() {
rm -rf "$HOME/.bc"
rm bettercode.sh
rm client.sh
rm server.sh
}

runClient() {
client
}

runServer() {
server &
}

run() {
runServer
runClient
}

runHelp() {
echo "BetterCode options:"

echo "Install program: install"
echo "Update program: update"
echo "Uninstall program: uninstall"

echo "Run client and server: run"
echo "Run client only: client"
echo "Run server only: server"
}

parseArgs() {
if [$1 = "run"] then
run
elif [$1 = "client"] then
runClient
elif [$1 = "server"] then
runServer
elif [$1 = "install"] then
installDeps
install
elif [$1 = "update"] then
update
elif [$1 = "uninstall"] then
uninstall
elif [$1 = "help"] then
runHelp
else
echo "Invalid command, run bettercode help to see all arguments"
fi

}

parseArgs
5 changes: 5 additions & 0 deletions scripts/client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

cd "$HOME/.bc/bettercode"
#this is where ssh port forwarding
lein run localhost
4 changes: 4 additions & 0 deletions scripts/server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

cd "$HOME/.bc/betterCode/bettercodeserver"
lein run

0 comments on commit 7698b69

Please sign in to comment.