init commit

This commit is contained in:
Josh Ashton
2023-09-11 21:39:18 -06:00
parent b5136b661b
commit bd5da60cf4
6 changed files with 50 additions and 10 deletions
Executable
+16
View File
@@ -0,0 +1,16 @@
#!/bin/zsh
TARGET=$1
if [[ -e $TARGET.mkv ]]; then
ffmpeg -i $TARGET.mkv -n $TARGET.mp3
rm $TARGET.mkv
elif [[ -e $TARGET.webm ]]; then
ffmpeg -i $TARGET.webm -n $TARGET.mp3
rm $TARGET.webm
elif [[ -e $TARGET.mp4 ]]; then
ffmpeg -i $TARGET.mp4 -n $TARGET.mp3
rm $TARGET.mp4
else
echo "file not found"
fi
+9 -1
View File
@@ -8,7 +8,7 @@
# quaxlyqueen/scripts/ginit
# Supported languages.
TYPES=("c", "rust", "c-sharp", "java", "js", "t3", "python", "flutter", "go")
TYPES=("c", "rust", "c-sharp", "aspnet", "java", "js", "t3", "python", "flutter", "go")
# Catch case where there are too many arguments.
if [[ $# -gt 3 ]]; then
@@ -107,6 +107,14 @@ elif [[ $LANG == "c-sharp" ]]; then
mark; # Bookmark new project.
dotnet new console # Create a new console app with dotnet.
# Create a new ASP.NET project.
elif [[ $LANG == "aspnet" ]]; then
dotnet new globaljson --output $NAME
dotnet new mvc --no-https $NAME
dotnet new sln -o $NAME
dotnet sln $NAME add $NAME
cd $NAME
# Create a new Java project with Gradle.
elif [[ $LANG == "java" ]]; then
mkdir $NAME;
+2 -3
View File
@@ -116,12 +116,11 @@ elif [[ $TYPE == "cs" ]]; then
elif [[ $TYPE == "java" ]]; then
clear
echo "Compiling..."
javac -cp $CP *.java
javac *.java
echo "Output...";
java -cp $CP $NAME $ARGS
java $NAME $ARGS
rm *.class
# Run JavaScript app.
elif [[ $TYPE == "js" ]]; then
clear
+17 -6
View File
@@ -4,6 +4,7 @@
#include <limits.h>
#include <stdlib.h>
/*
void error() {
printf("\nImproper usage: goto[ keyword ]\n"
" Usage:\n"
@@ -25,7 +26,7 @@ void help() {
" goto --help"
);
}
*/
void validateDir(char input[]) {
//char * bookmarksFile = strcat(getenv("HOME"), "/.bookmarks");
char * bookmarksFile = "/home/jashton/.bookmarks";
@@ -41,9 +42,18 @@ void validateDir(char input[]) {
if(getcwd(cwd, sizeof(cwd)) != NULL) {
printf("cwd: %s\n", cwd);
}
chdir("..");
if(getcwd(cwd, sizeof(cwd)) != NULL) {
printf("cwd: %s\n", cwd);
char *line = NULL;
size_t len = 0;
ssize_t read;
while((read = getline(&line, &len, f)) != -1) {
printf("%s", line);
if(strstr(line, input) != NULL) {
printf("%s", line);
chdir(line);
return;
}
}
}
}
@@ -52,11 +62,12 @@ int main(int argc, char *argv[]) {
// Invalid number of arguments.
if(argc != 2) {
error();
//error();
printf("error");
return 1;
}
// Display help.
else if(strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) help();
else if(strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) printf("help");
else validateDir(argv[1]);
}
BIN
View File
Binary file not shown.
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/zsh
TARGET=$1
TRASH=/home/jashton/trash/
mv $TARGET $TRASH