init commit
This commit is contained in:
@@ -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
@@ -8,7 +8,7 @@
|
|||||||
# quaxlyqueen/scripts/ginit
|
# quaxlyqueen/scripts/ginit
|
||||||
|
|
||||||
# Supported languages.
|
# 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.
|
# Catch case where there are too many arguments.
|
||||||
if [[ $# -gt 3 ]]; then
|
if [[ $# -gt 3 ]]; then
|
||||||
@@ -107,6 +107,14 @@ elif [[ $LANG == "c-sharp" ]]; then
|
|||||||
mark; # Bookmark new project.
|
mark; # Bookmark new project.
|
||||||
dotnet new console # Create a new console app with dotnet.
|
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.
|
# Create a new Java project with Gradle.
|
||||||
elif [[ $LANG == "java" ]]; then
|
elif [[ $LANG == "java" ]]; then
|
||||||
mkdir $NAME;
|
mkdir $NAME;
|
||||||
|
|||||||
@@ -116,12 +116,11 @@ elif [[ $TYPE == "cs" ]]; then
|
|||||||
elif [[ $TYPE == "java" ]]; then
|
elif [[ $TYPE == "java" ]]; then
|
||||||
clear
|
clear
|
||||||
echo "Compiling..."
|
echo "Compiling..."
|
||||||
javac -cp $CP *.java
|
javac *.java
|
||||||
echo "Output...";
|
echo "Output...";
|
||||||
java -cp $CP $NAME $ARGS
|
java $NAME $ARGS
|
||||||
rm *.class
|
rm *.class
|
||||||
|
|
||||||
|
|
||||||
# Run JavaScript app.
|
# Run JavaScript app.
|
||||||
elif [[ $TYPE == "js" ]]; then
|
elif [[ $TYPE == "js" ]]; then
|
||||||
clear
|
clear
|
||||||
|
|||||||
+17
-6
@@ -4,6 +4,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/*
|
||||||
void error() {
|
void error() {
|
||||||
printf("\nImproper usage: goto[ keyword ]\n"
|
printf("\nImproper usage: goto[ keyword ]\n"
|
||||||
" Usage:\n"
|
" Usage:\n"
|
||||||
@@ -25,7 +26,7 @@ void help() {
|
|||||||
" goto --help"
|
" goto --help"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
void validateDir(char input[]) {
|
void validateDir(char input[]) {
|
||||||
//char * bookmarksFile = strcat(getenv("HOME"), "/.bookmarks");
|
//char * bookmarksFile = strcat(getenv("HOME"), "/.bookmarks");
|
||||||
char * bookmarksFile = "/home/jashton/.bookmarks";
|
char * bookmarksFile = "/home/jashton/.bookmarks";
|
||||||
@@ -41,9 +42,18 @@ void validateDir(char input[]) {
|
|||||||
if(getcwd(cwd, sizeof(cwd)) != NULL) {
|
if(getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||||
printf("cwd: %s\n", cwd);
|
printf("cwd: %s\n", cwd);
|
||||||
}
|
}
|
||||||
chdir("..");
|
|
||||||
if(getcwd(cwd, sizeof(cwd)) != NULL) {
|
char *line = NULL;
|
||||||
printf("cwd: %s\n", cwd);
|
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.
|
// Invalid number of arguments.
|
||||||
if(argc != 2) {
|
if(argc != 2) {
|
||||||
error();
|
//error();
|
||||||
|
printf("error");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display help.
|
// 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]);
|
else validateDir(argv[1]);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user