File tree 1 file changed +7
-12
lines changed
1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,17 @@ import (
13
13
)
14
14
15
15
var bashWrapper = `#!{{.Bash}}
16
- cat <<EOF | base64 --decode > {{.JsOutput}}
16
+ file="${XDG_RUNTIME_DIR:-/tmp}/{{.Hash}}-ags.js"
17
+
18
+ cat <<EOF | base64 --decode > $file
17
19
{{.JsCode}}
18
20
EOF
19
21
20
- LD_PRELOAD="{{.Gtk4LayerShell}}" {{.Gjs}} -m {{.JsOutput}} $@`
22
+ LD_PRELOAD="{{.Gtk4LayerShell}}" {{.Gjs}} -m $file $@`
21
23
22
24
type WrapperArgs struct {
23
25
Bash string
24
- JsOutput string
26
+ Hash string
25
27
JsCode string
26
28
Gtk4LayerShell string
27
29
Gjs string
@@ -102,18 +104,11 @@ func bundle(cmd *cobra.Command, args []string) {
102
104
lib .Err ("internal error" )
103
105
}
104
106
105
- rundir , found := os .LookupEnv ("XDG_RUNTIME_DIR" )
106
- if ! found {
107
- rundir = "/tmp"
108
- }
109
-
110
107
jscode := result .OutputFiles [0 ].Contents
111
- id := base64 .RawURLEncoding .EncodeToString (jscode )[:6 ]
112
- tmpfile := filepath .Join (rundir , id + "-ags.js" )
113
108
114
109
wrapperArgs := WrapperArgs {
115
- JsOutput : tmpfile ,
116
- JsCode : base64 .StdEncoding .EncodeToString (result . OutputFiles [ 0 ]. Contents ),
110
+ Hash : base64 . RawURLEncoding . EncodeToString ( jscode )[: 6 ] ,
111
+ JsCode : base64 .StdEncoding .EncodeToString (jscode ),
117
112
Gtk4LayerShell : gtk4LayerShell ,
118
113
Bash : bash ,
119
114
Gjs : gjs ,
You can’t perform that action at this time.
0 commit comments