update to newproject and run scripts to include python

This commit is contained in:
Josh Ashton
2023-06-23 15:20:35 -06:00
parent 243808ac82
commit 5e3db229df
3 changed files with 20 additions and 6 deletions
+2 -3
View File
@@ -12,13 +12,12 @@ if [[ $1 == "-h" || $1 == "--help" ]]; then
# Lookup a user. # Lookup a user.
elif [[ $1 == "user" ]]; then elif [[ $1 == "user" ]]; then
firefox https://github.com/$2 firefox "https://github.com/search?q=$2&type=users"
# Lookup a repo. # Lookup a repo.
elif [[ $1 == "repo" ]]; then elif [[ $1 == "repo" ]]; then
# TODO need to implement. firefox "https://github.com/search?q=$2&type=repositories"
firefox https://github.com/$2
# Catch any invalid input. # Catch any invalid input.
else else
+11 -2
View File
@@ -8,7 +8,7 @@
# quaxlyqueen/scripts/ginit # quaxlyqueen/scripts/ginit
# Supported languages. # Supported languages.
TYPES=("c", "c-sharp", "java", "js", "go") TYPES=("c", "c-sharp", "java", "js", "python", "go")
# Catch case where there are too many arguments. # Catch case where there are too many arguments.
if [[ $# -gt 3 ]]; then if [[ $# -gt 3 ]]; then
@@ -84,7 +84,6 @@ else
fi fi
fi fi
# Create a new C project. # Create a new C project.
if [[ $LANG == "c" ]]; then if [[ $LANG == "c" ]]; then
cp -r ~/templates/c ./$NAME # Copy the template C file. cp -r ~/templates/c ./$NAME # Copy the template C file.
@@ -114,12 +113,22 @@ elif [[ $LANG == "html" ]]; then
cd public_html; cd public_html;
mark; # Bookmark new project. mark; # Bookmark new project.
# Create a new JavaScript project.
elif [[ $LANG == "js" ]]; then elif [[ $LANG == "js" ]]; then
mkdir $NAME; mkdir $NAME;
cd $NAME; cd $NAME;
touch main.js; touch main.js;
mark; # Bookmark new project. mark; # Bookmark new project.
# Create a new Python project.
elif [[ $LANG == "python" ]]; then
mkdir $NAME;
cd $NAME;
touch main.py;
echo "print(\"hello world!\")" >> main.py;
mark;
fi fi
# If the user indicated the project will be a Git project, then run the ginit script. # If the user indicated the project will be a Git project, then run the ginit script.
+7 -1
View File
@@ -1,7 +1,7 @@
#!/bin/zsh #!/bin/zsh
# Supported languages. # Supported languages.
TYPES=("c", "cs", "java", "js", "go") TYPES=("c", "cs", "java", "js", "python", "go")
# Catch case where there are too many arguments. # Catch case where there are too many arguments.
if [[ $# -gt 1 ]]; then if [[ $# -gt 1 ]]; then
@@ -119,6 +119,12 @@ elif [[ $TYPE == "js" ]]; then
echo "Output..." echo "Output..."
node $NAME.js node $NAME.js
# Run Python app.
elif [[ $TYPE == "py" ]]; then
clear
echo "Running..."
python $FILE.py
# Run Golang app. # Run Golang app.
elif [[ $TYPE == "go" ]]; then elif [[ $TYPE == "go" ]]; then
clear clear