This commit is contained in:
Josh Ashton
2023-07-12 15:16:18 -06:00
parent d85367c819
commit fbf5b4308d
9 changed files with 100 additions and 6 deletions
+10 -1
View File
@@ -1,10 +1,12 @@
#!/bin/zsh
# 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 "\ngpush [ \"message\" | -h | --help ]"
echo " gpush \"init commit\""
echo " gpush -l \"init commit\""
echo " gpush --local \"init commit\""
echo " gpush -h"
echo " gpush --help"
@@ -18,11 +20,18 @@ elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "\n\nUsage:"
echo "\ngit-push [ \"message\" | -h | --help ]"
echo " gpush \"init commit\""
echo " gpush -l \"init commit\""
echo " gpush --local \"init commit\""
echo " gpush -h"
echo " gpush --help"
exit
# Commit changes to local repository.
elif [[ $1 == "-l" || $1 == "--local" ]]; then
git stage -A
git commit -m "$2"
# Push changes to remote repository.
else
git stage -A
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/zsh
+11 -4
View File
@@ -8,7 +8,7 @@
# quaxlyqueen/scripts/ginit
# 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.
if [[ $# -gt 3 ]]; then
@@ -22,7 +22,7 @@ if [[ $# -gt 3 ]]; then
echo " newproject -h"
echo " newproject --help\n"
echo "Supported languages: $TYPES"
echo "Supported languages/stacks: $TYPES"
exit
@@ -44,7 +44,7 @@ elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo " newproject -h"
echo " newproject --help\n"
echo "Supported languages: $TYPES"
echo "Supported languages/stacks: $TYPES"
exit
@@ -103,7 +103,7 @@ elif [[ $LANG == "java" ]]; then
mkdir $NAME;
cd $NAME;
mark; # Bookmark new project.
gradle7 init
gradle init
# Create a new HTML, CSS, JS project.
elif [[ $LANG == "html" ]]; then
@@ -130,6 +130,13 @@ elif [[ $LANG == "python" ]]; then
touch main.py;
echo "print(\"hello world!\")" >> main.py;
mark;
# Create a new Flutter/Dart project.
elif [[ $LANG == "flutter" ]]; then
flutter create $NAME
cd $NAME
mark;
fi
# If the user indicated the project will be a Git project, then run the ginit script.
Executable
+7
View File
@@ -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;
Executable
BIN
View File
Binary file not shown.
+60
View File
@@ -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
View File
@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
// Append the current directory to the bookmarks file.
else if(argc == 1) {
char cwd[PATH_MAX];
fprintf(f, getcwd(cwd, sizeof(cwd)));
fprintf(f, "%s", getcwd(cwd, sizeof(cwd)));
printf("Successfully bookmarked %s.", cwd);
}
Executable
BIN
View File
Binary file not shown.
+9
View File
@@ -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"));
}