update to newproject and run scripts to include python
This commit is contained in:
@@ -12,13 +12,12 @@ if [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
|
||||
# Lookup a user.
|
||||
elif [[ $1 == "user" ]]; then
|
||||
firefox https://github.com/$2
|
||||
firefox "https://github.com/search?q=$2&type=users"
|
||||
|
||||
# Lookup a repo.
|
||||
elif [[ $1 == "repo" ]]; then
|
||||
|
||||
# TODO need to implement.
|
||||
firefox https://github.com/$2
|
||||
firefox "https://github.com/search?q=$2&type=repositories"
|
||||
|
||||
# Catch any invalid input.
|
||||
else
|
||||
|
||||
+11
-2
@@ -8,7 +8,7 @@
|
||||
# quaxlyqueen/scripts/ginit
|
||||
|
||||
# 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.
|
||||
if [[ $# -gt 3 ]]; then
|
||||
@@ -84,7 +84,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Create a new C project.
|
||||
if [[ $LANG == "c" ]]; then
|
||||
cp -r ~/templates/c ./$NAME # Copy the template C file.
|
||||
@@ -114,12 +113,22 @@ elif [[ $LANG == "html" ]]; then
|
||||
cd public_html;
|
||||
mark; # Bookmark new project.
|
||||
|
||||
# Create a new JavaScript project.
|
||||
elif [[ $LANG == "js" ]]; then
|
||||
mkdir $NAME;
|
||||
cd $NAME;
|
||||
|
||||
touch main.js;
|
||||
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
|
||||
|
||||
# If the user indicated the project will be a Git project, then run the ginit script.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Supported languages.
|
||||
TYPES=("c", "cs", "java", "js", "go")
|
||||
TYPES=("c", "cs", "java", "js", "python", "go")
|
||||
|
||||
# Catch case where there are too many arguments.
|
||||
if [[ $# -gt 1 ]]; then
|
||||
@@ -119,6 +119,12 @@ elif [[ $TYPE == "js" ]]; then
|
||||
echo "Output..."
|
||||
node $NAME.js
|
||||
|
||||
# Run Python app.
|
||||
elif [[ $TYPE == "py" ]]; then
|
||||
clear
|
||||
echo "Running..."
|
||||
python $FILE.py
|
||||
|
||||
# Run Golang app.
|
||||
elif [[ $TYPE == "go" ]]; then
|
||||
clear
|
||||
|
||||
Reference in New Issue
Block a user