REMOVE CRUFT <3
Jes Olson j3s@c3f.net
Wed, 28 Sep 2022 02:10:49 -0500
1 files changed,
0 insertions(+),
65 deletions(-)
jump to
M
shell/shell.go
→
shell/shell.go
@@ -39,8 +39,6 @@ log.Fatal(err)
} } -var last string - func CallHandler(ctx context.Context, args []string) ([]string, error) { // hc := interp.HandlerCtx(ctx)@@ -115,69 +113,6 @@ fmt.Println(err)
os.Exit(1) } } - -// execute every statement individually, decorating -// each with ->, and doing some speshul logicks against -// certain strings -// for _, stmt := range script.Stmts { -// fullCmd := commandName(stmt) -// command, after, _ := strings.Cut(fullCmd, " ") - -// if command == "zoa-script" { -// // recursion detected!!!!!! :3 :3 :3 -// subScriptPath := filepath.Join("scripts/" + after) -// RunCommands(zoaRoot, subScriptPath, r) -// continue -// } - -// if command == "zoa-file" { -// // after = "nginx /etc/nginx/conf.d/jesse.conf systemctl nginx reload" -// zoaFileParts := strings.Split(after, " ") -// if len(zoaFileParts) < 2 { -// log.Fatal("zoa-file requires 2+ arguments") -// } -// src := zoaFileParts[0] -// dst := zoaFileParts[1] -// optionalCmd := "" -// if len(zoaFileParts) > 2 { -// optionalCmd = strings.Join(zoaFileParts[2:], " ") -// } -// fmt.Printf("$ zoa-file %s %s\n", src, dst) -// filePath := filepath.Join(zoaRoot, "files", src) -// dstChanged, err := zoaCopy(filePath, dst) -// if err != nil { -// log.Fatal(err) -// } -// // if there's an optional argument -// if optionalCmd != "" && dstChanged { -// re := strings.NewReader(optionalCmd) -// f, err := syntax.NewParser().Parse(re, "") -// if err != nil { -// log.Fatal(err) -// } - -// for _, stmt := range f.Stmts { -// runCommand(ctx, stmt, r) -// } -// } -// continue -// } - -// if the script name changed between runs, -// print it -// if scriptPath != lastScriptPath { -// utils.BluePrintln("-> " + scriptPath) -// lastScriptPath = scriptPath -// } - -// fmt.Printf("$ %s\n", fullCmd) -// // todo: better colorz idk utils.BluePrintln("$ " + cmdName) -// err = r.Run(ctx, stmt) -// if err != nil { -// // ignore err here bc it's just the status code -// os.Exit(1) -// } -// } func parseFile(filename string) (*syntax.File, error) { var result = &syntax.File{}