Skip to content

Commit

Permalink
Allow templating main
Browse files Browse the repository at this point in the history
  • Loading branch information
reknih committed Oct 31, 2024
1 parent b2d8134 commit 3913e21
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ if [ "$#" -ne 1 ]; then
exit 1
fi

if [[ "$1" = "main" ]]; then
tag=$1
version=git-$(date +"%Y-%m-%dT%H:%M:%SZ")
echo "Version: $version"
echo "Tag: $tag"

mkdir -p snap
sed "s/source-tag: \"<tag>\"/source-branch: $tag/g; s/<version>/$version/g" snapcraft.tpl.yaml > snap/snapcraft.yaml

echo "Written snap/snapcraft.yaml"
exit 0
fi

if [[ ! "$1" =~ ^v ]]; then
echo "Argument must start with a 'v'"
exit 1
Expand Down

0 comments on commit 3913e21

Please sign in to comment.