From 52fc892c9c60d362451ad9aad196ed83e675b91f Mon Sep 17 00:00:00 2001 From: Nitix Date: Sun, 23 Oct 2016 03:41:37 +0200 Subject: [PATCH 1/2] Fix building --- NadekoInstaller.sh | 88 +++++++++++++++++++++++++++++++--------------- NadekoRun.sh | 29 ++++++++------- 2 files changed, 76 insertions(+), 41 deletions(-) diff --git a/NadekoInstaller.sh b/NadekoInstaller.sh index 0663cb6aa..10bccbad9 100644 --- a/NadekoInstaller.sh +++ b/NadekoInstaller.sh @@ -1,29 +1,59 @@ -#!/bin/bash - -echo "NadekoBot 1.0 Download" -echo "Mirai was here." - -if git 2>&1 >/dev/null -then echo "Git Installed." -else echo "Git is not installed. Please install Git." | exit 1 - -if dotnet 2>&1 >/dev/null -then echo "Dotnet installed." -else echo "Dotnet is not installed. Please install dotnet." | exit 1 - -mkdir NadekoInstall_Temp -echo "Created NadekoBot-temp folder" -cd NadekoInstall_Temp -echo "Downloading NadekoBot, please wait." -git clone -b 1.0 --recursive -v https://github.com/Kwoth/NadekoBot.git -echo "NadekoBot downloaded." -cd NadekoInstall_Temp/NadekoBot/ -dotnet restore >nul 2>&1 -cd NadekoInstall_Temp/NadekoBot/src/NadekoBot/ -echo "Building NadekoBot" -dotnet build --configuration Release -echo "Setting up NadekoBot" -dotnet build --configuration Release -echo "Done. You can close the window." - -exit 0 +#!/bin/sh + +echo "NadekoBot 1.0 Download" +echo "Mirai was here." + +if hash git 2>/dev/null +then + echo "Git Installed." +else + echo "Git is not installed. Please install Git." + exit 1 +fi + +if hash dotnet 2>/dev/null +then + echo "Dotnet installed." +else + echo "Dotnet is not installed. Please install dotnet." + exit 1 +fi + +root=$(pwd) + +rm -r NadekoInstall_Temp 2>/dev/null +mkdir NadekoInstall_Temp +cd NadekoInstall_Temp +echo "Created NadekoBot-temp folder" + +echo "Downloading NadekoBot, please wait." +git clone -b 1.0 --recursive --depth 1 https://github.com/Kwoth/NadekoBot.git +echo "NadekoBot downloaded." + + +echo "Downloading Nadeko dependencies" +cd NadekoBot +dotnet restore >nul 2>&1 +echo "Download done" + +echo "Building NadekoBot" +cd src/NadekoBot/ +dotnet build --configuration Release + +echo "Building done. Moving Nadeko" + +cd "$root" +if [ ! -d NadekoBot ] +then + mkdir NadekoBot.backup 2>/dev/null +else + echo "Backing up old Nadeko" + mv --backup=numbered NadekoBot NadekoBot.backup +fi + +mv NadekoInstall_Temp/NadekoBot NadekoBot +rm -r NadekoInstall_Temp + +echo "Done." + +exit 0 \ No newline at end of file diff --git a/NadekoRun.sh b/NadekoRun.sh index fc2a3f335..a34772449 100644 --- a/NadekoRun.sh +++ b/NadekoRun.sh @@ -1,14 +1,19 @@ #!/bin/bash - echo "NadekoBot 1.0" - echo "Mirai was here." - if git 2>&1 >/dev/null; - then echo "Git Installed." - else echo "Git is not installed. Please install Git." | exit 1 - if dotnet 2>&1 >/dev/null; - then echo "Dotnet installed." - else echo "Dotnet is not installed. Please install dotnet." | exit 1 - cd NadekoBot/src/NadekoBot - echo "Running NadekoBot. Please wait." - dotnet run --configuration Release - echo "Done" + +echo "NadekoBot 1.0" +echo "Mirai was here." + +if hash dotnet 2>/dev/null +then + echo "Dotnet installed." +else + echo "Dotnet is not installed. Please install dotnet." + exit 1 +fi + +cd NadekoBot/src/NadekoBot +echo "Running NadekoBot. Please wait." +dotnet run --configuration Release +echo "Done" + exit 0 From 3674815254ada5a2b2c6770b955b575a1ee6e2c7 Mon Sep 17 00:00:00 2001 From: Nitix Date: Sun, 23 Oct 2016 03:42:58 +0200 Subject: [PATCH 2/2] Fix sh script on run --- NadekoRun.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoRun.sh b/NadekoRun.sh index a34772449..f982914fc 100644 --- a/NadekoRun.sh +++ b/NadekoRun.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh echo "NadekoBot 1.0" echo "Mirai was here."