8000 add environment to the main app · NuruProgramming/NuruIDLE@dd2036e · GitHub
[go: up one dir, main page]

Skip to content

Commit dd2036e

Browse files
committed
add environment to the main app
1 parent 3e1db82 commit dd2036e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
// App struct
1111
type App struct {
1212
ctx context.Context
13+
env *object.Environment
1314
}
1415

1516
// NewApp creates a new App application struct
@@ -25,6 +26,5 @@ func (a *App) startup(ctx context.Context) {
2526

2627
// Greet returns a greeting for the given name
2728
func (a *App) Start(name string) (string, []string) {
28-
env := object.NewEnvironment()
29-
return repl.Start(name, env)
29+
return repl.Start(name, a.env)
3030
}

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"embed"
55

6+
"github.com/NuruProgramming/NuruIDLE/object"
67
"github.com/wailsapp/wails/v2"
78
"github.com/wailsapp/wails/v2/pkg/options"
89
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
@@ -14,6 +15,9 @@ var assets embed.FS
1415
func main() {
1516
// Create an instance of the app structure
1617
app := NewApp()
18+
env := object.NewEnvironment()
19+
20+
app.env = env
1721

1822
// Create application with options
1923
err := wails.Run(&options.App{

0 commit comments

Comments
 (0)
0