mirror of
https://github.com/EnumeratedDev/bpm-utils.git
synced 2026-09-16 11:06:11 +00:00
It is no longer necessary to type the output name of the source bpm file
This commit is contained in:
+12
-14
@@ -1,9 +1,4 @@
|
||||
#!/bin/bash
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo "No output package name given!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f .compilation-options ]; then
|
||||
source ./.compilation-options
|
||||
@@ -20,9 +15,19 @@ while getopts "cskfa:" flag; do
|
||||
esac
|
||||
done
|
||||
|
||||
output="${@:$OPTIND:1}"
|
||||
if [ -f pkg.info ]; then
|
||||
echo "pkg.info file found"
|
||||
else
|
||||
echo "pkg.info file not found in $PWD"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! "$output" =~ ^[a-z.A-Z0-9_-]{1,}$ ]]; then
|
||||
output="${@:$OPTIND:1}"
|
||||
if [ -z "$output" ]; then
|
||||
pkgname=$(grep "^name: " pkg.info)
|
||||
output=$(echo "$pkgname" | cut -d' ' -f2)"-src.bpm"
|
||||
fi
|
||||
if [ -z "$output" ] || [[ ! "$output" =~ ^[a-z.A-Z0-9_-]{1,}$ ]]; then
|
||||
echo "Invalid output name! The name must only contain letters, numbers, hyphens or underscores!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -72,13 +77,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f pkg.info ]; then
|
||||
echo "pkg.info file found"
|
||||
else
|
||||
echo "pkg.info file not found in $PWD"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for pkginfo in ./pkg.inf*; do
|
||||
pkginfo=$(basename "$pkginfo")
|
||||
echo "${pkginfo} file found"
|
||||
|
||||
Reference in New Issue
Block a user