Created
March 21, 2018 15:31
-
-
Save tameemsafi/b7c982cd6c73e2e72b69310e681e17e0 to your computer and use it in GitHub Desktop.
Copy dvsa front-end assets into specific folder
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/bash | |
# Hide all output | |
# exec 1>/dev/null 2>/dev/null | |
# Set git version tag | |
version="1.1.20" | |
# Set github repo url | |
repoUrl="https://github.com/dvsa/front-end.git" | |
# Assets src path | |
assetsSrcPath="src/main/resources/assets" | |
# Set temp assets folder path | |
tempAssetsFolderPath="temp/certificate-assets" | |
# Set temp assets dist folder path | |
tempAssetsDistFolderPath="$tempAssetsFolderPath/dist/assets" | |
# Remove temp git folder | |
remove_temp_assets_folder () { | |
rm -rf "$tempAssetsFolderPath" | |
} | |
echo "Remove temp folder" | |
remove_temp_assets_folder | |
echo "Clone git repo into temp folder" | |
git clone --branch "v$version" "$repoUrl" "$tempAssetsFolderPath" | |
echo "Remove current assets source folder" | |
rm -rf "$assetsSrcPath" | |
echo "Re-create assets source folder" | |
mkdir "$assetsSrcPath" | |
echo "Copy assets from temp folder to source folder" | |
cp -R "$tempAssetsDistFolderPath/*" "$assetsSrcPath/" | |
echo "Remove temp folder" | |
remove_temp_assets_folder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment