-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
101 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
FROM ubuntu:24.04 | ||
|
||
|
||
WORKDIR /workspace | ||
|
||
RUN apt update | ||
RUN apt install -y curl python3 | ||
RUN apt install -y curl python3 git | ||
|
||
#RUN cp -r /workspaces/templify/scripts/bin/* /usr/local/bin | ||
|
||
COPY scripts /usr/local/bin | ||
#RUN /workspaces/templify/scripts/setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
|
||
function help() { | ||
echo "Usage: psc <command>" | ||
echo "This is a alias for the './scripts/' command" | ||
} | ||
|
||
command=$1 | ||
|
||
if [ -z $command ]; then | ||
echo "No command provided" | ||
help | ||
exit 1 | ||
fi | ||
|
||
if [ $command == "init" ] || [ $command == "i" ]; then | ||
mkdir -p .scripts | ||
echo "Directory '.scripts' created" | ||
exit 0 | ||
elif [ $command == "help" ] || [ $command == "h" ]; then | ||
help | ||
exit 0 | ||
fi | ||
|
||
dir=".scripts" | ||
if [ ! -d $dir ]; then | ||
dir=".script" | ||
fi | ||
if [ ! -d $dir ]; then | ||
dir="scripts" | ||
fi | ||
if [ ! -d $dir ]; then | ||
dir="script" | ||
fi | ||
if [ ! -d $dir ]; then | ||
echo "Directory '.scripts' not found" | ||
echo "Run 'psc init' to create the directory" | ||
exit 1 | ||
fi | ||
|
||
if [ $command == "list" ] || [ $command == "l" ]; then | ||
echo "Available scripts:" | ||
ls $dir | ||
exit 0 | ||
fi | ||
|
||
if [ $command == "add" ] || [ $command == "a" ]; then | ||
name=$2 | ||
if [ -z $name ]; then | ||
echo "No name provided" | ||
help | ||
exit 1 | ||
fi | ||
file="$dir/$name.sh" | ||
if [ -f $file ]; then | ||
echo "File already exists" | ||
exit 1 | ||
fi | ||
|
||
echo "#!/bin/bash" > $file | ||
echo "" >> $file | ||
echo "echo \"Running $name\"" >> $file | ||
chmod +x $file | ||
echo "File created: $file" | ||
exit 0 | ||
fi | ||
|
||
|
||
|
||
file="$dir/$*" | ||
|
||
if [ ! -f $file ]; then | ||
file="$dir/$*.sh" | ||
fi | ||
|
||
if [ -f $file ]; then | ||
echo "Running $file" | ||
bash $file | ||
else | ||
echo "File not found" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
#templify development command | ||
cargo run $* --dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
#!/bin/bash | ||
|
||
python3 scripts/py/check_comment.py | ||
if command -v python &> /dev/null | ||
then | ||
python scripts/py/check_comment.py | ||
else | ||
python3 scripts/py/check_comment.py | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters