shithub: ricket

Download patch

ref: 4c1519486a789eb4e2375a0a4ab52fa1aaeb007c
parent: 6ab0465159d0c03e597fdd898c7883341b3d6d0e
author: Slashscreen <SlashScreen@users.noreply.github.com>
date: Fri Sep 8 12:08:24 EDT 2023

updated mkfile

--- a/install.rc
+++ /dev/null
@@ -1,4 +1,0 @@
-#!bin/rc
-mv ricket /amd64/ricket/bin
-bind -b /amd64/ricket/bin /bin
-mv ricket.troff /sys/man/1
\ No newline at end of file
--- /dev/null
+++ b/mkfile
@@ -1,0 +1,9 @@
+ARCH = amd64
+
+install:V:
+	cp ricket /$ARCH/bin/ricket
+	cp ricket.troff /sys/man/1/ricket
+
+clean:V:
+    rm /$ARCH/bin/ricket
+    rm /sys/man/1/ricket
binary files a/ricket.exe /dev/null differ
--- a/ricket.go
+++ b/ricket.go
@@ -15,6 +15,8 @@
 	"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"
 )
 
+const arch = "amd64"
+
 func main() {
 	if len(os.Args) == 1 {
 		fmt.Println("Not enough arguments. Type \"ricket help\" for usage.")
@@ -142,7 +144,7 @@
 
 	{ // Step 4: Write install file
 		output := format_install(program_name)
-		dst, err := os.Create(fmt.Sprintf("%s/install.rc", bin_dir))
+		dst, err := os.Create(fmt.Sprintf("%s/mkfile", bin_dir))
 		if err != nil {
 			fmt.Printf("Error while writing install file: %s", err)
 			return
@@ -168,8 +170,12 @@
 }
 
 func format_install(name string) string {
-	return fmt.Sprintf(`#!/bin/rc
-mv %s /amd64/%s/bin
-bind -b /amd64/%s/bin /bin
-	`, name, name, name)
+	return fmt.Sprintf(`
+ARCH = %s
+USER = glenda
+
+install:V:
+	cp %s /$ARCH/%s/bin
+	echo "bind -b /$ARCH/%s/bin /bin" > /usr/$USER/profile
+	`, arch, name, name, name)
 } // TODO: Other architectures
--- a/ricket.troff
+++ b/ricket.troff
@@ -70,9 +70,9 @@
 .B -o
 is passed) with the relevant arguments.
 
-4. an install script that will finish installation into your system. 
+4. a mkfile that will finish installation into your system. 
 Simply type
-.I install
+.I mk install
 to finish.
 .RE
 The program itself is the .rc file, allowing the user to simply type