Last active
August 29, 2015 14:24
-
-
Save diegobfernandez/a42e244336a9f8406740 to your computer and use it in GitHub Desktop.
Install editorconfig-core-net on Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
REPOSITORY=https://github.com/editorconfig/editorconfig-core-net.git | |
INSTALL_DIR=~/.editorconfig-core-net | |
REPOSITORY_DIR=$INSTALL_DIR/repository | |
APPLICATION_SRC_DIR=$REPOSITORY_DIR/src/EditorConfig.App | |
BUILD_CONFIGURATION=Release | |
echo "Cleaning up old versions with they exists" | |
rm -rf $INSTALL_DIR | |
echo "Create installation directory" | |
mkdir -p $REPOSITORY_DIR | |
echo "Cloning git repository" | |
git clone $REPOSITORY $REPOSITORY_DIR | |
echo "Restoring NuGet packages" | |
cd $REPOSITORY_DIR | |
nuget restore | |
echo "Building application" | |
cd $APPLICATION_SRC_DIR | |
xbuild /property:Configuration=$BUILD_CONFIGURATION | |
echo "Copying files to installation directory" | |
cp $APPLICATION_SRC_DIR/bin/$BUILD_CONFIGURATION/* $INSTALL_DIR | |
echo "Cleaning up repository directory" | |
rm -rf $REPOSITORY_DIR | |
echo "Check if alias editorconfig-core-net is already defined else define it" | |
command -v editorconfig-core-net >/dev/null && echo "Yeah, alias already defined." || { | |
echo "Alias not found. Creating it for you" | |
echo "function editorconfig-core-net() { mono $INSTALL_DIR/editorconfig.exe \"\$@\"; }" >> ~/.bashrc; | |
} | |
echo "Good to go!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment