updates
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
# Catch any input that is invalid.
|
# Catch any input that is invalid.
|
||||||
if [[ $# -eq 0 || $# -gt 1 ]]; then
|
if [[ $# -eq 0 || ($# -gt 1 && ( $1 != "-l" || $1 != "--local" )) ]]; then
|
||||||
echo "\nImproper usage. Try:"
|
echo "\nImproper usage. Try:"
|
||||||
echo "\ngpush [ \"message\" | -h | --help ]"
|
echo "\ngpush [ \"message\" | -h | --help ]"
|
||||||
echo " gpush \"init commit\""
|
echo " gpush \"init commit\""
|
||||||
|
echo " gpush -l \"init commit\""
|
||||||
|
echo " gpush --local \"init commit\""
|
||||||
echo " gpush -h"
|
echo " gpush -h"
|
||||||
echo " gpush --help"
|
echo " gpush --help"
|
||||||
|
|
||||||
@@ -18,11 +20,18 @@ elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
|||||||
echo "\n\nUsage:"
|
echo "\n\nUsage:"
|
||||||
echo "\ngit-push [ \"message\" | -h | --help ]"
|
echo "\ngit-push [ \"message\" | -h | --help ]"
|
||||||
echo " gpush \"init commit\""
|
echo " gpush \"init commit\""
|
||||||
|
echo " gpush -l \"init commit\""
|
||||||
|
echo " gpush --local \"init commit\""
|
||||||
echo " gpush -h"
|
echo " gpush -h"
|
||||||
echo " gpush --help"
|
echo " gpush --help"
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
||||||
|
# Commit changes to local repository.
|
||||||
|
elif [[ $1 == "-l" || $1 == "--local" ]]; then
|
||||||
|
git stage -A
|
||||||
|
git commit -m "$2"
|
||||||
|
|
||||||
# Push changes to remote repository.
|
# Push changes to remote repository.
|
||||||
else
|
else
|
||||||
git stage -A
|
git stage -A
|
||||||
|
|||||||
+11
-4
@@ -8,7 +8,7 @@
|
|||||||
# quaxlyqueen/scripts/ginit
|
# quaxlyqueen/scripts/ginit
|
||||||
|
|
||||||
# Supported languages.
|
# Supported languages.
|
||||||
TYPES=("c", "c-sharp", "java", "js", "python", "go")
|
TYPES=("c", "c-sharp", "java", "js", "t3", "python", "flutter", "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
|
||||||
@@ -22,7 +22,7 @@ if [[ $# -gt 3 ]]; then
|
|||||||
echo " newproject -h"
|
echo " newproject -h"
|
||||||
echo " newproject --help\n"
|
echo " newproject --help\n"
|
||||||
|
|
||||||
echo "Supported languages: $TYPES"
|
echo "Supported languages/stacks: $TYPES"
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
|||||||
echo " newproject -h"
|
echo " newproject -h"
|
||||||
echo " newproject --help\n"
|
echo " newproject --help\n"
|
||||||
|
|
||||||
echo "Supported languages: $TYPES"
|
echo "Supported languages/stacks: $TYPES"
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ elif [[ $LANG == "java" ]]; then
|
|||||||
mkdir $NAME;
|
mkdir $NAME;
|
||||||
cd $NAME;
|
cd $NAME;
|
||||||
mark; # Bookmark new project.
|
mark; # Bookmark new project.
|
||||||
gradle7 init
|
gradle init
|
||||||
|
|
||||||
# Create a new HTML, CSS, JS project.
|
# Create a new HTML, CSS, JS project.
|
||||||
elif [[ $LANG == "html" ]]; then
|
elif [[ $LANG == "html" ]]; then
|
||||||
@@ -130,6 +130,13 @@ elif [[ $LANG == "python" ]]; then
|
|||||||
touch main.py;
|
touch main.py;
|
||||||
echo "print(\"hello world!\")" >> main.py;
|
echo "print(\"hello world!\")" >> main.py;
|
||||||
mark;
|
mark;
|
||||||
|
|
||||||
|
# Create a new Flutter/Dart project.
|
||||||
|
elif [[ $LANG == "flutter" ]]; then
|
||||||
|
flutter create $NAME
|
||||||
|
cd $NAME
|
||||||
|
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.
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
mkdir dev docs downloads pictures school tmp;
|
||||||
|
sudo pacman -S alacritty android-tools archlinux-keyring aspnet-runtime base blender bluebubbles-desktop-app code dart devhelp devhelp-docs dhcpcd discord docker dotnet-sdk dracut efibootmgr feh firefox flatpak fzf gcc git github-cli godot gradle i3-wm i3lock i3status intel-ucode iwd java-openjfx java-openjfx-doc java-openjfx-src jdk-openjdk jgrasp jre-openjdk keepassxc kubeadm kubectl libreoffice-fresh linux linux-firmware luarocks man-db man-pages maven mono nasm neofetch neovim nerd-fonts-complete-starship net-tools networkmanager network-manager-applet ninja nitrogen nmap npm nvidia obs-studio os-prober php picom pavucontrol pidgin python python-pip reflector rofi rust simplescreenrecorder sof-firmware starship steam sudo tar texinfo thunar tldr typescript unrar vi virtualbox vlc wavpack wget wireshark-cli wl-clipboard xob xorg yarn yay zoom zoxide zsh
|
||||||
|
git clone https://github.com/quaxlyqueen/notes;
|
||||||
|
git clone https://github.com/quaxlyqueen/templates;
|
||||||
|
cd dev; git clone https://github.com/quaxlyqueen/scripts;
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void error() {
|
||||||
|
printf("\nImproper usage: goto[ keyword ]\n"
|
||||||
|
" Usage:\n"
|
||||||
|
" goto downloads\n"
|
||||||
|
" goto school\n"
|
||||||
|
" goto portfolio\n"
|
||||||
|
" goto -h\n"
|
||||||
|
" goto --help"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void help() {
|
||||||
|
printf("\nQuickly navigate to saved bookmarks in the terminal.\n"
|
||||||
|
" Usage:\n"
|
||||||
|
" goto downloads\n"
|
||||||
|
" goto school\n"
|
||||||
|
" goto portfolio\n"
|
||||||
|
" goto -h\n"
|
||||||
|
" goto --help"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void validateDir(char input[]) {
|
||||||
|
//char * bookmarksFile = strcat(getenv("HOME"), "/.bookmarks");
|
||||||
|
char * bookmarksFile = "/home/jashton/.bookmarks";
|
||||||
|
FILE * f = fopen(bookmarksFile, "r");
|
||||||
|
|
||||||
|
// Unable to access file.
|
||||||
|
if(f == NULL) {
|
||||||
|
printf("Error accessing file located at %s.\n", bookmarksFile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
char cwd[PATH_MAX];
|
||||||
|
if(getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||||
|
printf("cwd: %s\n", cwd);
|
||||||
|
}
|
||||||
|
chdir("..");
|
||||||
|
printf("cwd: %s", cwd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
|
// Invalid number of arguments.
|
||||||
|
if(argc != 2) {
|
||||||
|
error();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display help.
|
||||||
|
else if(strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) help();
|
||||||
|
else validateDir(argv[1]);
|
||||||
|
}
|
||||||
+1
-1
@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// Append the current directory to the bookmarks file.
|
// Append the current directory to the bookmarks file.
|
||||||
else if(argc == 1) {
|
else if(argc == 1) {
|
||||||
char cwd[PATH_MAX];
|
char cwd[PATH_MAX];
|
||||||
fprintf(f, getcwd(cwd, sizeof(cwd)));
|
fprintf(f, "%s", getcwd(cwd, sizeof(cwd)));
|
||||||
printf("Successfully bookmarked %s.", cwd);
|
printf("Successfully bookmarked %s.", cwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("%s", getenv("CWD"));
|
||||||
|
chdir("/home/jashton/dev");
|
||||||
|
printf("%s", getenv("CWD"));
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user