This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
forked from lunarmodules/lua_cliargs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrote a script to automate tarball creation for luarocks manifest
- Loading branch information
Showing
4 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
PKG="lua_cliargs" | ||
MAJOR=$1 | ||
MINOR=$2 | ||
FQN="${PKG}-${MAJOR}.${MINOR}" | ||
|
||
if [ -d "$FQN" ]; then | ||
echo -en "Will not overwrite existing directory '$FQN'. " | ||
echo -en "\e[00;31m[ FAILED ]\e[00m\n" | ||
exit 1 | ||
fi | ||
|
||
if [ -f "$FQN.tar.gz" ]; then | ||
echo -en "Overwriting tar archive '$FQN.tar.gz'. " | ||
echo -en "\e[00;33m[ WARNING ]\e[00m\n" | ||
|
||
rm "$FQN.tar.gz" | ||
fi | ||
|
||
ln -s ../ "$FQN" | ||
tar --exclude-vcs --exclude=tarballs -hzvcf "$FQN.tar.gz" "$FQN" | ||
rm "$FQN" | ||
|
||
echo -en "Archive created: '$FQN'. " | ||
echo -en "\e[00;32m[ SUCCESS ]\e[00m\n" | ||
exit 0 |
Binary file not shown.