This commit is contained in:
2025-12-31 14:15:38 -05:00
parent f91cd9032c
commit 28ab22181f

53
ures Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
#
# Micro Releaser
set -eu
me=$0
scriptversion="1.0.0"
version="$me $scriptversion
Copyright (C) 2025 vx-clutch.
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
usage="\
Usage: $me [OPTION]... VERSION DIR
Micro Releaser
Options:
--help print this help and exit
--version output version information
"
while [ $# -gt 0 ]; do
case $1 in
--help) echo "$usage"; exit 0 ;;
--version) echo "$version"; exit 0 ;;
--*) echo "$me: Unknown option '$1'." >&2; exit 1 ;;
*) break ;;
esac
done
[ $# -eq 2 ] || { echo "$me: expected VERSION and DIR" >&2; exit 1; }
version_name=$1
src_dir=$2
[ -d "$src_dir" ] || { echo "$me: '$src_dir' is not a directory" >&2; exit 1; }
case $version_name in
*/*|"") echo "$me: invalid version name" >&2; exit 1 ;;
esac
tarball=$version_name.tar.gz
(
cd "$src_dir"
tar -czf "$tarball" --transform="s,^,$version_name/," $(git ls-files)
)
printf '%s\n' "$tarball created successfully"