Compare commits
9 Commits
b3a7d03fcd
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| cf5751840a | |||
| 5133045b31 | |||
| fc3d0a2e69 | |||
| 3073d4e88f | |||
| deca2349cf | |||
| a4f455deec | |||
| 12e838c0f0 | |||
| b54989f0ee | |||
| bbc8030dfb |
40
bin/yait
40
bin/yait
@@ -1,19 +1,17 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Highly opinionated C and SH project generator
|
# Highly opinionated C and SH project generator
|
||||||
|
|
||||||
scriptversion="0.0.1"
|
scriptversion="0.3.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
|
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
me=$(basename "$0")
|
me=$(basename "$0")
|
||||||
version="$me\/fSD v$scriptversion
|
version="$me/fSD v$scriptversion
|
||||||
|
|
||||||
Copyright (C) 2025-2026 fSD.
|
Copyright (C) 2025-2026 fSD.
|
||||||
This is free software; you are free to change and redistribute it.
|
This is free software; you are free to change and redistribute it.
|
||||||
@@ -33,7 +31,7 @@ Options:
|
|||||||
-f overwrite existing files
|
-f overwrite existing files
|
||||||
-a <author> set project author
|
-a <author> set project author
|
||||||
-r initialize Git repository for the project
|
-r initialize Git repository for the project
|
||||||
-q surpress output"
|
-q suppress output"
|
||||||
|
|
||||||
x=c # language
|
x=c # language
|
||||||
d="Does a thing" # package description
|
d="Does a thing" # package description
|
||||||
@@ -55,6 +53,7 @@ lsay() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# main creation routine
|
||||||
create_project() {
|
create_project() {
|
||||||
name=$1
|
name=$1
|
||||||
|
|
||||||
@@ -63,12 +62,19 @@ create_project() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# creates a shell project
|
||||||
shell() {
|
shell() {
|
||||||
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
|
||||||
@@ -132,7 +138,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"
|
||||||
@@ -195,9 +201,15 @@ EOF
|
|||||||
chmod +x "$outfile"
|
chmod +x "$outfile"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# creates a C project
|
||||||
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')
|
||||||
@@ -266,7 +278,7 @@ all: $name
|
|||||||
config.h:
|
config.h:
|
||||||
cp config.def.h \$@
|
cp config.def.h \$@
|
||||||
|
|
||||||
dwm: \${OBJ}
|
$name: \${OBJ}
|
||||||
\${CC} -o \$@ \${OBJ} \${LDFLAGS}
|
\${CC} -o \$@ \${OBJ} \${LDFLAGS}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@@ -424,6 +436,10 @@ EOF
|
|||||||
*) c ;;
|
*) c ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if ! [ -z "$r" ]; then
|
||||||
|
git init -q || echo "$me: error: could not initilzie git repository" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
say "made $name at $(realpath "$name")"
|
say "made $name at $(realpath "$name")"
|
||||||
cd ..
|
cd ..
|
||||||
}
|
}
|
||||||
|
|||||||
9
yait.1
9
yait.1
@@ -1,7 +1,7 @@
|
|||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH YAIT "1" "January 2026" "yait v1" "User Commands"
|
.TH FSD "1" "January 2026" "fSD v0.2.1" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
yait \- manual page for yait v1
|
fSD \- manual page for fSD v0.2.1
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B yait
|
.B yait
|
||||||
[\fI\,OPTION\/\fR]... \fI\,<version> <dir>\/\fR
|
[\fI\,OPTION\/\fR]... \fI\,<version> <dir>\/\fR
|
||||||
@@ -17,6 +17,8 @@ output version information
|
|||||||
.TP
|
.TP
|
||||||
\fB\-x\fR <language>
|
\fB\-x\fR <language>
|
||||||
set project type
|
set project type
|
||||||
|
.HP
|
||||||
|
\fB\-d\fR <description> set a description
|
||||||
.TP
|
.TP
|
||||||
\fB\-S\fR
|
\fB\-S\fR
|
||||||
small project creation
|
small project creation
|
||||||
@@ -24,9 +26,6 @@ small project creation
|
|||||||
\fB\-f\fR
|
\fB\-f\fR
|
||||||
overwrite existing files
|
overwrite existing files
|
||||||
.TP
|
.TP
|
||||||
\fB\-n\fR <name>
|
|
||||||
set project name
|
|
||||||
.TP
|
|
||||||
\fB\-a\fR <author>
|
\fB\-a\fR <author>
|
||||||
set project author
|
set project author
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
Reference in New Issue
Block a user