@treeport/treeport 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,6 @@ treeport .
10
10
 
11
11
  Treeport starts its backend if needed, registers the repository and its trees, and opens the current tree in the desktop app or browser. Run `treeport start` to start only the backend. Use `treeport service enable` when a host must start Treeport after reboot.
12
12
 
13
- Treeport supports macOS and Linux. It requires Node.js 24 or newer, npm, Git, and tmux 3.2 or newer.
13
+ Treeport supports macOS and Linux. It requires Node.js 24 or newer, npm, and Git.
14
14
 
15
15
  Documentation: <https://treeport.app>
package/bin/treeport.mjs CHANGED
@@ -1,4 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import { constants as fsConstants } from 'node:fs'
4
+ import { access } from 'node:fs/promises'
5
+ import path from 'node:path'
6
+ import { pathToFileURL } from 'node:url'
7
+
8
+ let cliEntrypoint = new URL('../dist/node/cli/index.js', import.meta.url)
9
+ const daemonRecord = process.env.TREEPORT_DAEMON_RECORD?.trim()
10
+ if (daemonRecord) {
11
+ const developmentRuntime = path.dirname(path.dirname(daemonRecord))
12
+ if (path.basename(developmentRuntime) === '.treeport-dev') {
13
+ const developmentCli = path.join(
14
+ path.dirname(developmentRuntime),
15
+ '.treeport-dev-dist/node/cli/index.js'
16
+ )
17
+ if (
18
+ await access(developmentCli, fsConstants.X_OK).then(
19
+ () => true,
20
+ () => false
21
+ )
22
+ ) {
23
+ cliEntrypoint = pathToFileURL(developmentCli)
24
+ }
25
+ }
26
+ }
27
+
3
28
  process.env.TREEPORT_CLI_ENTRYPOINT ??= process.argv[1]
4
- await import('../dist/node/cli/index.js')
29
+ await import(cliEntrypoint.href)