Skip to content

Commit

Permalink
backup - 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cophilot committed Nov 11, 2024
1 parent 4ba02a7 commit d79f1ec
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 12 deletions.
11 changes: 3 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"name": "templify-dev-container",
"runArgs": ["--name", "templify-dev-container"],
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile-dev"
},
"features": {
"ghcr.io/devcontainers/features/rust:1": {
"version": "1.76",
"profile": "complete",
"targets": "aarch64-unknown-linux-gnu"
}
}
"features": {}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile-dev
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
81 changes: 81 additions & 0 deletions scripts/bin/psc
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
3 changes: 3 additions & 0 deletions scripts/bin/tpyd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
#templify development command
cargo run $* --dev
7 changes: 6 additions & 1 deletion scripts/comment-check
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
2 changes: 1 addition & 1 deletion scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Install rust
if ! command -v rustup &> /dev/null
then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Install cargo
source $HOME/.cargo/env
Expand Down

0 comments on commit d79f1ec

Please sign in to comment.