Skip to content

Commit f7840aa

Browse files
committed
Update package and use new fork.
1 parent 9c36fbb commit f7840aa

File tree

6 files changed

+24
-28
lines changed

6 files changed

+24
-28
lines changed

examples/package.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sdk: ^2.0.0-alpha.144
1+
sdk: ^2.0.0-alpha.170
22
prefixes:
33
desktop: ..
44
packages:
@@ -9,5 +9,5 @@ packages:
99
pkg-host:
1010
url: github.com/toitlang/pkg-host
1111
name: host
12-
version: 1.15.3
13-
hash: 62393e8522b77eafbafe60b9817935266117daf6
12+
version: 1.16.2
13+
hash: ae83f761db80166a20bb38498edd009916b72563

package.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
sdk: ^2.0.0-alpha.144
1+
sdk: ^2.0.0-alpha.170
22
prefixes:
33
host: pkg-host
44
packages:
55
pkg-host:
66
url: github.com/toitlang/pkg-host
77
name: host
8-
version: 1.15.3
9-
hash: 62393e8522b77eafbafe60b9817935266117daf6
8+
version: 1.16.2
9+
hash: ae83f761db80166a20bb38498edd009916b72563

package.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: desktop
22
description: Cross platform functionality, based on XDG (Cross-Desktop Group) specifications.
33
environment:
4-
sdk: ^2.0.0-alpha.120
4+
sdk: ^2.0.0-alpha.170
55
dependencies:
66
host:
77
url: github.com/toitlang/pkg-host
8-
version: ^1.15.3
8+
version: ^1.16.2

src/desktop.toit

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,14 @@ open-browser url/string --timeout-ms/int=20_000:
124124
throw "Unsupported platform"
125125

126126
if command != null:
127-
fork-data := pipe.fork
128-
true // Use path.
129-
pipe.PIPE-CREATED // Stdin.
130-
pipe.PIPE-CREATED // Stdout.
131-
pipe.PIPE-CREATED // Stderr.
132-
command
133-
[ command ] + args
134-
stdin := fork-data[0]
135-
stdout/pipe.OpenPipe := fork-data[1]
136-
stderr/pipe.OpenPipe := fork-data[2]
137-
pid := fork-data[3]
138-
stdin.out.close
127+
process := pipe.fork command ([command] + args)
128+
--create-stdin
129+
--create-stdout
130+
--create-stderr
131+
--use-path
132+
process.stdin.close
133+
stdout := process.stdout
134+
stderr := process.stderr
139135
task --background:: catch: stdout.in.drain
140136
task --background:: catch: stderr.in.drain
141137
task --background::
@@ -146,17 +142,17 @@ open-browser url/string --timeout-ms/int=20_000:
146142
// example inside a server), we need to make sure we don't keep
147143
// spawned processes around.
148144
exception := catch: with-timeout --ms=timeout-ms:
149-
pipe.wait-for pid
145+
process.wait
150146
if exception == DEADLINE-EXCEEDED-ERROR:
151147
killed := false
152148
if platform != system.PLATFORM-WINDOWS:
153149
// Try a gentle kill first.
154150
SIGTERM ::= 15
155151
catch:
156-
pipe.kill_ pid SIGTERM
152+
pipe.kill_ process.pid SIGTERM
157153
with-timeout --ms=1_000:
158-
pipe.wait-for pid
154+
process.wait
159155
killed = true
160156
if not killed:
161157
SIGKILL ::= 9
162-
catch: pipe.kill_ pid SIGKILL
158+
catch: pipe.kill_ process.pid SIGKILL

tests/package.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sdk: ^2.0.0-alpha.120
1+
sdk: ^2.0.0-alpha.170
22
prefixes:
33
desktop: ..
44
host: pkg-host
@@ -10,5 +10,5 @@ packages:
1010
pkg-host:
1111
url: github.com/toitlang/pkg-host
1212
name: host
13-
version: 1.12.0
14-
hash: fe5e10c56abc3fca1ef9bcba415e77fd59183cab
13+
version: 1.16.2
14+
hash: ae83f761db80166a20bb38498edd009916b72563

tests/package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dependencies:
33
path: ..
44
host:
55
url: github.com/toitlang/pkg-host
6-
version: ^1.12.0
6+
version: ^1.16.2

0 commit comments

Comments
 (0)