Skip to content

Commit

Permalink
Merge pull request #378 from refaktor/allin
Browse files Browse the repository at this point in the history
improvements to cmd and util/ryel script
  • Loading branch information
refaktor authored Oct 15, 2024
2 parents d444974 + 26b7d80 commit be5bf4e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 62 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,5 @@ tests/*.html
shell_*.rye
console_*.rye

<<<<<<< HEAD
buildtemp/main.rye
*.bson

=======
buildtemp/main.rye
>>>>>>> 48009d9729854bd7bbbc0a943f839fc579a2943b
24 changes: 24 additions & 0 deletions evaldo/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -7949,6 +7949,30 @@ var builtins = map[string]*env.Builtin{
/* Terminal functions .. move to it's own later */

"cmd": {
Argsn: 1,
Doc: "",
Fn: func(ps *env.ProgramState, arg0 env.Object, arg1 env.Object, arg2 env.Object, arg3 env.Object, arg4 env.Object) env.Object {
switch s0 := arg0.(type) {
case env.String:

r := exec.Command("/bin/bash", "-c", s0.Value) //nolint: gosec
// stdout, stderr := r.Output()
r.Stdout = os.Stdout
r.Stderr = os.Stderr

err := r.Run()
if err != nil {
fmt.Println("ERROR")
fmt.Println(err)
}
default:
return makeError(ps, "Arg 1 should be String")
}
return nil
},
},

"cmd\\capture": {
Argsn: 1,
Doc: "",
Fn: func(ps *env.ProgramState, arg0 env.Object, arg1 env.Object, arg2 env.Object, arg3 env.Object, arg4 env.Object) env.Object {
Expand Down
57 changes: 0 additions & 57 deletions runner/buildtemp/main.rye

This file was deleted.

21 changes: 21 additions & 0 deletions util/ryel.rye
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,27 @@ build-ryel: fn { tags } {
; print "Build command: " + command
cmd command
}

build-fyne: fn { tags } {

print-header

open %ryel.mod
|fix\either
{ print "Create rye.mod file and list modules." " nil " }
{ .read-all }
|load
|map { .to-string .concat* "b_" }
|join\with " " :modules |print

cp-embed: either tags = "embed_main" { "cp main.rye %RYE_HOME/runner/buildtemp/. ; " } { "" }

command: join { cp-embed ` a=%PWD ; cd %RYE_HOME-fyne ; fyne release -os android -appID com.refaktorlabs.fynetest1 -icon Icon.png -appVersion 0.0.1 -tags "` + modules + " " + tags `"; cd "%a"` } ; ` delimiter for string is just temporary ... ' conflicts with lit-words and Rebols { } with blocks so this question is open so far
command .replace "%" "$" ::command
; print "Build command: " + command
cmd command
}

install-ryel: fn { } {
print-header
print "TODO: Installing Ryel ..."
Expand All @@ -44,6 +64,7 @@ rye .args -> 0 |fix { "" } :mode
rye .args -> 1 |fix { "" } :tags

switch mode {
"buildfyne" { build-fyne tags }
"build" { build-ryel tags }
"install" { install-ryel }
}
Expand Down

0 comments on commit be5bf4e

Please sign in to comment.