implement -f
This commit is contained in:
23
bin/yait
23
bin/yait
@@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Highly opinionated C and SH project generator
|
# Highly opinionated C and SH project generator
|
||||||
|
|
||||||
scriptversion="0.1.1"
|
scriptversion="0.2.1"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2025-2026 fSD THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# Copyright (C) 2025-2026 fSD THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
@@ -65,8 +65,14 @@ create_project() {
|
|||||||
outfile="$name"
|
outfile="$name"
|
||||||
|
|
||||||
if [ -z "$S" ]; then
|
if [ -z "$S" ]; then
|
||||||
mkdir "$name" || return
|
if [ -d "$name" ]; then
|
||||||
cd "$name" || return
|
if ! [ -z "$f" ]; then
|
||||||
|
rm -rf "$name"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir "$name" || exit 1
|
||||||
|
cd "$name" || exit 1
|
||||||
|
|
||||||
cat <<EOF > LICENSE
|
cat <<EOF > LICENSE
|
||||||
ISC License
|
ISC License
|
||||||
@@ -130,7 +136,7 @@ This tool runs via the command \`$name\`.
|
|||||||
- \`$name -k\` -- Does option k
|
- \`$name -k\` -- Does option k
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
mkdir bin || return
|
mkdir bin || exit 1
|
||||||
outfile="bin/$outfile"
|
outfile="bin/$outfile"
|
||||||
fi
|
fi
|
||||||
cat <<EOF > "$outfile"
|
cat <<EOF > "$outfile"
|
||||||
@@ -194,8 +200,13 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
c() {
|
c() {
|
||||||
mkdir "$name" || return
|
if [ -d "$name" ]; then
|
||||||
cd "$name" || return
|
if ! [ -z "$f" ]; then
|
||||||
|
rm -rf "$name"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
mkdir "$name" || exit 1
|
||||||
|
cd "$name" || exit 1
|
||||||
cat <<EOF > README
|
cat <<EOF > README
|
||||||
$name
|
$name
|
||||||
$(echo "$name" | sed 's/./=/g')
|
$(echo "$name" | sed 's/./=/g')
|
||||||
|
|||||||
Reference in New Issue
Block a user