update install script and readme

main
Evan Hemsley 2020-03-03 16:22:12 -08:00
parent 86a64e00b2
commit fd0070ffae
2 changed files with 20 additions and 12 deletions

View File

@ -20,7 +20,13 @@ Template and build tasks for developing a cross-platform multi-target .NET Frame
## Installation
- Download this repository
- Run `install.sh` if you are on Linux/OSX or `install.ps1` if you are on Windows and follow the instructions
- Run `install.sh` if you are on Linux/OSX or `install.ps1` if you are on Windows
- Move the newly created project directory wherever you want
## Usage
- Open the project directory in VSCode
- Press Ctrl-Shift-B to open the build tasks menu
## Acknowledgments

24
install.sh Normal file → Executable file
View File

@ -5,7 +5,7 @@
# This file is heavily borrowed from Caleb Cornett's template install script.
# Get the directory of this script
MY_DIR=$(dirname "$BASH_SOURCE")
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Checks if git is installed
function checkGit()
@ -60,25 +60,27 @@ function getLibs()
getLibs
read -p "Enter the project name to use for your folder and csproj file or 'exit' to quit: " newProjectName
read -p "Enter your project name or 'exit' to quit: " newProjectName
if [[ $newProjectName = 'exit' || -z "$newProjectName" ]]; then
exit 1
fi
# copy everything into new dir
cd ..
NEW_PROJECT_DIR=$(pwd "./${newProjectName}")
NEW_PROJECT_DIR="$MY_DIR/../$newProjectName"
cp -R $MY_DIR $NEW_PROJECT_DIR
cd $NEW_PROJECT_DIR
files=(ProjectName.Core.sln ProjectName.Framework.sln .gitignore ProjectName/ProjectName.Core.csproj ProjectName/ProjectName.Framework.csproj ProjectName/ProjectNameGame.cs ProjectName/Program.cs .vscode/tasks.json .vscode/launch.json)
for file in "${files[@]}"; do
sed -i '' "s/ProjectName/$newProjectName/g" $file
sed -i -e "s/ProjectName/$newProjectName/g" "./$file"
done
mv ProjectName.Core.sln "$newProjectName.Core.sln"
mv ProjectName.Framework.sln "$newProjectName.Framework.sln"
mv ProjectName/ProjectName.Core.csproj "ProjectName/$newProjectName.Core.csproj"
mv ProjectName/ProjectName.Framework.csproj "ProjectName/$newProjectName.Framework.csproj"
mv ProjectName/ProjectNameGame.cs ProjectName/${newProjectName}Game.cs
mv ProjectName "$newProjectName"
mv ./ProjectName.Core.sln "./$newProjectName.Core.sln"
mv ./ProjectName.Framework.sln "./$newProjectName.Framework.sln"
mv ./ProjectName/ProjectName.Core.csproj "./ProjectName/$newProjectName.Core.csproj"
mv ./ProjectName/ProjectName.Framework.csproj "./ProjectName/$newProjectName.Framework.csproj"
mv ./ProjectName/ProjectNameGame.cs ./ProjectName/${newProjectName}Game.cs
mv ./ProjectName "./$newProjectName"
rm ./install.sh
echo "Project $newProjectName created at $(readlink -f $NEW_PROJECT_DIR)"