mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-11-04 22:15:36 -07:00
fdf2775640
kiss' help output will now include all executables found in $PATH which begin with kiss-*. A comment string is optionally usable via setting the second line of the script to a string. Example: ... This also means that 'kiss <script name>' is also possible now. If I have a script in my $PATH called kiss-depends, I can now use it via kiss with 'kiss depends'.
47 lines
819 B
Bash
Executable File
47 lines
819 B
Bash
Executable File
#!/bin/sh
|
|
# Create a boilerplate package.
|
|
|
|
die() {
|
|
printf 'error: %s.\n' "$*" >&2
|
|
exit 1
|
|
}
|
|
|
|
log() {
|
|
printf '=> %s.\n' "$*"
|
|
}
|
|
|
|
main() {
|
|
[ "$1" ] || {
|
|
log Create boilerplate KISS packages
|
|
log Usage: kiss-new name version source
|
|
|
|
exit
|
|
}
|
|
|
|
[ -d "$1" ] &&
|
|
die Package "$1" already exists.
|
|
|
|
mkdir -p "$1" ||
|
|
die Couldn\'t create directory in "$PWD"
|
|
|
|
cd "$1" ||
|
|
die Couldn\'t enter directory "$1/"
|
|
|
|
log Creating build file; {
|
|
printf '#!/bin/sh -e\n' > build
|
|
chmod +x build
|
|
}
|
|
|
|
log Creating version file with "'${2%% *} 1'"; {
|
|
printf '%s\n' "${2%% *} 1" > version
|
|
}
|
|
|
|
log Creating sources file with "'$3'"; {
|
|
printf '%s\n' "$3" > sources
|
|
}
|
|
|
|
log Package "$1" created in "$PWD"
|
|
}
|
|
|
|
main "$@"
|