Skip to content

Commit cfadaa4

Browse files
committed
Fixixng install messaging, tuzig#103
1 parent 3cc2525 commit cfadaa4

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ and the release workflow reads it to set github's release notes.
1414
### Added
1515

1616
- the status command shows the chosen ICE candidate pairs for connected peers
17+
- WEBEXEC environment variable to hold the unix socket path
18+
19+
### Fixed
20+
21+
- installer messages improved
1722

1823
## [1.4.0] 2024-4-14
1924

conf.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ func parseConf(s string) (*peers.Conf, httpserver.AddressType, error) {
184184
Conf.insecure = v.(bool)
185185
}
186186
// get env vars
187+
peersConf.Env = map[string]string{"WEBEXEC": GetSockFP()}
187188
m := t.Get("env")
188189
if m != nil {
189-
peersConf.Env = make(map[string]string)
190190
for k, v := range m.(*toml.Tree).ToMap() {
191191
peersConf.Env[k] = v.(string)
192192
}

conf_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ import (
99

1010
func TestConfEnv(t *testing.T) {
1111
initTest(t)
12-
require.EqualValues(t, Conf.peerConf.Env["TERM"], "xterm")
12+
require.EqualValues(t, Conf.peerConf.Env["TERM"], "xterm-256color")
1313
require.EqualValues(t, Conf.peerConf.Env["COLORTERM"], "truecolor")
1414
}

sites/get/install.bash

+3-4
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ do_install() {
128128
cd $tmp
129129
fi
130130
get_n_extract $tmp
131-
if [[ $(ps -o comm= -p $PPID) == *webexec ]]
131+
if [ -v WEBEXEC ]
132132
then
133133
if [ ! -d $HOME/.config/webexec ]
134134
then
135135
./webexec init
136136
fi
137-
echo "Moving to another shell to survive this connection ending"
138-
$sh_c "nohup bash ./replace_n_launch.sh $user ${HOME:-/root}"
137+
echo "Closing connections, replacing and launching"
138+
nohup bash ./replace_n_launch.sh "$sh_c"
139139
else
140140
if command_exists webexec
141141
then
@@ -156,7 +156,6 @@ do_install() {
156156
then
157157
exit "Failed starting webexec"
158158
fi
159-
echo "Install finished, please exit and reconnect to enjoy version $LATEST_VERSION."
160159
fi
161160
}
162161
do_install "$@"

webexec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func start(c *cli.Context) error {
289289
if err != nil {
290290
return err
291291
}
292-
fmt.Printf("agent started as process #%d\n", pid)
292+
fmt.Printf("Agent started as process #%d\n", pid)
293293
versionNote := getVersionNote()
294294
if versionNote != "" {
295295
fmt.Println(versionNote)

0 commit comments

Comments
 (0)