summaryrefslogtreecommitdiffstats
path: root/makesrc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-xmakesrc.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/makesrc.sh b/makesrc.sh
index 87d223d..32df0cc 100755
--- a/makesrc.sh
+++ b/makesrc.sh
@@ -1,10 +1,17 @@
#!/bin/bash
NAME=$(basename $PWD)
-OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec)
-PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec)
-VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
-COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec)
+if [ "$1" = "dev" ]; then
+SPEC=$NAME-dev.spec
+COMP=composer-dev.json
+else
+SPEC=$NAME.spec
+COMP=composer.json
+fi
+OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $SPEC)
+PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $SPEC)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $SPEC)
+COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $SPEC)
SHORT=${COMMIT:0:7}
echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
@@ -16,7 +23,7 @@ git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
echo "Getting commit..."
pushd $PROJECT-$COMMIT
git checkout $COMMIT
-cp composer.json ../composer.json
+cp composer.json ../$COMP
popd
echo "Archiving..."