@fredlackey/devutils 0.0.1 → 0.0.3

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.
Files changed (259) hide show
  1. package/README.md +5 -5
  2. package/package.json +1 -1
  3. package/src/commands/install.js +374 -36
  4. package/src/installs/adobe-creative-cloud.js +527 -25
  5. package/src/installs/adobe-creative-cloud.md +605 -0
  6. package/src/installs/appcleaner.js +303 -26
  7. package/src/installs/appcleaner.md +699 -0
  8. package/src/installs/apt-transport-https.js +390 -0
  9. package/src/installs/apt-transport-https.md +678 -0
  10. package/src/installs/atomicparsley.js +624 -26
  11. package/src/installs/atomicparsley.md +795 -0
  12. package/src/installs/aws-cli.js +779 -26
  13. package/src/installs/aws-cli.md +727 -0
  14. package/src/installs/balena-etcher.js +688 -26
  15. package/src/installs/balena-etcher.md +761 -0
  16. package/src/installs/bambu-studio.js +912 -26
  17. package/src/installs/bambu-studio.md +780 -0
  18. package/src/installs/bash-completion.js +554 -23
  19. package/src/installs/bash-completion.md +833 -0
  20. package/src/installs/bash.js +399 -26
  21. package/src/installs/bash.md +993 -0
  22. package/src/installs/beyond-compare.js +585 -26
  23. package/src/installs/beyond-compare.md +813 -0
  24. package/src/installs/build-essential.js +511 -26
  25. package/src/installs/build-essential.md +977 -0
  26. package/src/installs/ca-certificates.js +618 -0
  27. package/src/installs/ca-certificates.md +937 -0
  28. package/src/installs/caffeine.js +490 -26
  29. package/src/installs/caffeine.md +839 -0
  30. package/src/installs/camtasia.js +577 -25
  31. package/src/installs/camtasia.md +762 -0
  32. package/src/installs/chatgpt.js +458 -26
  33. package/src/installs/chatgpt.md +814 -0
  34. package/src/installs/chocolatey.js +447 -0
  35. package/src/installs/chocolatey.md +661 -0
  36. package/src/installs/chrome-canary.js +472 -26
  37. package/src/installs/chrome-canary.md +641 -0
  38. package/src/installs/chromium.js +645 -26
  39. package/src/installs/chromium.md +838 -0
  40. package/src/installs/claude-code.js +558 -26
  41. package/src/installs/claude-code.md +1173 -0
  42. package/src/installs/curl.js +361 -26
  43. package/src/installs/curl.md +714 -0
  44. package/src/installs/cursor.js +561 -26
  45. package/src/installs/cursor.md +970 -0
  46. package/src/installs/dbschema.js +674 -26
  47. package/src/installs/dbschema.md +925 -0
  48. package/src/installs/dependencies.md +435 -0
  49. package/src/installs/development-tools.js +600 -0
  50. package/src/installs/development-tools.md +977 -0
  51. package/src/installs/docker.js +1010 -25
  52. package/src/installs/docker.md +1109 -0
  53. package/src/installs/drawio.js +1001 -26
  54. package/src/installs/drawio.md +795 -0
  55. package/src/installs/elmedia-player.js +328 -25
  56. package/src/installs/elmedia-player.md +556 -0
  57. package/src/installs/ffmpeg.js +870 -25
  58. package/src/installs/ffmpeg.md +852 -0
  59. package/src/installs/file.js +464 -0
  60. package/src/installs/file.md +987 -0
  61. package/src/installs/gemini-cli.js +793 -26
  62. package/src/installs/gemini-cli.md +1153 -0
  63. package/src/installs/git.js +382 -26
  64. package/src/installs/git.md +907 -0
  65. package/src/installs/gitego.js +931 -26
  66. package/src/installs/gitego.md +1172 -0
  67. package/src/installs/go.js +913 -26
  68. package/src/installs/go.md +958 -0
  69. package/src/installs/google-chrome.js +801 -25
  70. package/src/installs/google-chrome.md +862 -0
  71. package/src/installs/gpg.js +412 -73
  72. package/src/installs/gpg.md +1056 -0
  73. package/src/installs/homebrew.js +1015 -26
  74. package/src/installs/homebrew.md +988 -0
  75. package/src/installs/imageoptim.js +950 -26
  76. package/src/installs/imageoptim.md +1119 -0
  77. package/src/installs/installers.json +2297 -0
  78. package/src/installs/jq.js +382 -26
  79. package/src/installs/jq.md +809 -0
  80. package/src/installs/keyboard-maestro.js +701 -26
  81. package/src/installs/keyboard-maestro.md +825 -0
  82. package/src/installs/latex.js +771 -26
  83. package/src/installs/latex.md +1095 -0
  84. package/src/installs/lftp.js +338 -26
  85. package/src/installs/lftp.md +907 -0
  86. package/src/installs/lsb-release.js +346 -0
  87. package/src/installs/lsb-release.md +814 -0
  88. package/src/installs/messenger.js +829 -26
  89. package/src/installs/messenger.md +900 -0
  90. package/src/installs/microsoft-office.js +550 -26
  91. package/src/installs/microsoft-office.md +760 -0
  92. package/src/installs/microsoft-teams.js +782 -25
  93. package/src/installs/microsoft-teams.md +886 -0
  94. package/src/installs/node.js +886 -26
  95. package/src/installs/node.md +1153 -0
  96. package/src/installs/nordpass.js +698 -26
  97. package/src/installs/nordpass.md +921 -0
  98. package/src/installs/nvm.js +977 -26
  99. package/src/installs/nvm.md +1057 -0
  100. package/src/installs/openssh.js +734 -64
  101. package/src/installs/openssh.md +1056 -0
  102. package/src/installs/pandoc.js +644 -26
  103. package/src/installs/pandoc.md +1036 -0
  104. package/src/installs/pinentry.js +492 -26
  105. package/src/installs/pinentry.md +1142 -0
  106. package/src/installs/pngyu.js +851 -26
  107. package/src/installs/pngyu.md +896 -0
  108. package/src/installs/postman.js +781 -26
  109. package/src/installs/postman.md +940 -0
  110. package/src/installs/procps.js +425 -0
  111. package/src/installs/procps.md +851 -0
  112. package/src/installs/safari-tech-preview.js +355 -25
  113. package/src/installs/safari-tech-preview.md +533 -0
  114. package/src/installs/sfnt2woff.js +640 -26
  115. package/src/installs/sfnt2woff.md +795 -0
  116. package/src/installs/shellcheck.js +463 -26
  117. package/src/installs/shellcheck.md +1005 -0
  118. package/src/installs/slack.js +722 -25
  119. package/src/installs/slack.md +865 -0
  120. package/src/installs/snagit.js +566 -25
  121. package/src/installs/snagit.md +844 -0
  122. package/src/installs/software-properties-common.js +372 -0
  123. package/src/installs/software-properties-common.md +805 -0
  124. package/src/installs/spotify.js +858 -25
  125. package/src/installs/spotify.md +901 -0
  126. package/src/installs/studio-3t.js +803 -26
  127. package/src/installs/studio-3t.md +918 -0
  128. package/src/installs/sublime-text.js +780 -25
  129. package/src/installs/sublime-text.md +914 -0
  130. package/src/installs/superwhisper.js +687 -25
  131. package/src/installs/superwhisper.md +630 -0
  132. package/src/installs/tailscale.js +727 -26
  133. package/src/installs/tailscale.md +1100 -0
  134. package/src/installs/tar.js +389 -0
  135. package/src/installs/tar.md +946 -0
  136. package/src/installs/termius.js +780 -26
  137. package/src/installs/termius.md +844 -0
  138. package/src/installs/terraform.js +761 -26
  139. package/src/installs/terraform.md +899 -0
  140. package/src/installs/tidal.js +752 -25
  141. package/src/installs/tidal.md +864 -0
  142. package/src/installs/tmux.js +328 -26
  143. package/src/installs/tmux.md +1030 -0
  144. package/src/installs/tree.js +393 -26
  145. package/src/installs/tree.md +833 -0
  146. package/src/installs/unzip.js +460 -0
  147. package/src/installs/unzip.md +879 -0
  148. package/src/installs/vim.js +403 -26
  149. package/src/installs/vim.md +1040 -0
  150. package/src/installs/vlc.js +803 -26
  151. package/src/installs/vlc.md +927 -0
  152. package/src/installs/vscode.js +825 -26
  153. package/src/installs/vscode.md +1002 -0
  154. package/src/installs/wget.js +415 -0
  155. package/src/installs/wget.md +791 -0
  156. package/src/installs/whatsapp.js +710 -25
  157. package/src/installs/whatsapp.md +854 -0
  158. package/src/installs/winpty.js +352 -0
  159. package/src/installs/winpty.md +620 -0
  160. package/src/installs/woff2.js +535 -26
  161. package/src/installs/woff2.md +977 -0
  162. package/src/installs/wsl.js +572 -0
  163. package/src/installs/wsl.md +699 -0
  164. package/src/installs/xcode-clt.js +520 -0
  165. package/src/installs/xcode-clt.md +351 -0
  166. package/src/installs/xcode.js +542 -26
  167. package/src/installs/xcode.md +573 -0
  168. package/src/installs/yarn.js +806 -26
  169. package/src/installs/yarn.md +1074 -0
  170. package/src/installs/yq.js +636 -26
  171. package/src/installs/yq.md +944 -0
  172. package/src/installs/yt-dlp.js +683 -26
  173. package/src/installs/yt-dlp.md +946 -0
  174. package/src/installs/yum-utils.js +297 -0
  175. package/src/installs/yum-utils.md +648 -0
  176. package/src/installs/zoom.js +740 -25
  177. package/src/installs/zoom.md +884 -0
  178. package/src/scripts/README.md +567 -45
  179. package/src/scripts/STATUS.md +208 -0
  180. package/src/scripts/afk.js +395 -7
  181. package/src/scripts/backup-all.js +731 -9
  182. package/src/scripts/backup-source.js +711 -8
  183. package/src/scripts/brewd.js +373 -7
  184. package/src/scripts/brewi.js +505 -9
  185. package/src/scripts/brewr.js +512 -9
  186. package/src/scripts/brews.js +462 -9
  187. package/src/scripts/brewu.js +488 -7
  188. package/src/scripts/c.js +185 -7
  189. package/src/scripts/ccurl.js +325 -8
  190. package/src/scripts/certbot-crontab-init.js +488 -8
  191. package/src/scripts/certbot-init.js +641 -9
  192. package/src/scripts/ch.js +339 -7
  193. package/src/scripts/claude-danger.js +253 -8
  194. package/src/scripts/clean-dev.js +419 -8
  195. package/src/scripts/clear-dns-cache.js +525 -7
  196. package/src/scripts/clone.js +417 -7
  197. package/src/scripts/code-all.js +420 -7
  198. package/src/scripts/count-files.js +195 -8
  199. package/src/scripts/count-folders.js +195 -8
  200. package/src/scripts/count.js +248 -8
  201. package/src/scripts/d.js +203 -7
  202. package/src/scripts/datauri.js +373 -8
  203. package/src/scripts/delete-files.js +363 -7
  204. package/src/scripts/docker-clean.js +410 -8
  205. package/src/scripts/dp.js +426 -7
  206. package/src/scripts/e.js +375 -9
  207. package/src/scripts/empty-trash.js +497 -7
  208. package/src/scripts/evm.js +428 -9
  209. package/src/scripts/fetch-github-repos.js +441 -10
  210. package/src/scripts/get-channel.js +329 -8
  211. package/src/scripts/get-course.js +384 -11
  212. package/src/scripts/get-dependencies.js +290 -9
  213. package/src/scripts/get-folder.js +783 -10
  214. package/src/scripts/get-tunes.js +411 -10
  215. package/src/scripts/get-video.js +352 -9
  216. package/src/scripts/git-backup.js +561 -9
  217. package/src/scripts/git-clone.js +477 -9
  218. package/src/scripts/git-pup.js +303 -7
  219. package/src/scripts/git-push.js +380 -8
  220. package/src/scripts/h.js +607 -9
  221. package/src/scripts/hide-desktop-icons.js +483 -7
  222. package/src/scripts/hide-hidden-files.js +522 -7
  223. package/src/scripts/install-dependencies-from.js +440 -9
  224. package/src/scripts/ips.js +647 -10
  225. package/src/scripts/iso.js +354 -8
  226. package/src/scripts/killni.js +561 -7
  227. package/src/scripts/ll.js +451 -8
  228. package/src/scripts/local-ip.js +310 -8
  229. package/src/scripts/m.js +508 -8
  230. package/src/scripts/map.js +293 -8
  231. package/src/scripts/mkd.js +287 -7
  232. package/src/scripts/ncu-update-all.js +441 -8
  233. package/src/scripts/nginx-init.js +702 -12
  234. package/src/scripts/npmi.js +366 -7
  235. package/src/scripts/o.js +495 -8
  236. package/src/scripts/org-by-date.js +321 -7
  237. package/src/scripts/p.js +208 -7
  238. package/src/scripts/packages.js +313 -8
  239. package/src/scripts/path.js +209 -7
  240. package/src/scripts/ports.js +582 -8
  241. package/src/scripts/q.js +290 -8
  242. package/src/scripts/refresh-files.js +378 -10
  243. package/src/scripts/remove-smaller-files.js +500 -8
  244. package/src/scripts/rename-files-with-date.js +517 -9
  245. package/src/scripts/resize-image.js +523 -9
  246. package/src/scripts/rm-safe.js +653 -8
  247. package/src/scripts/s.js +525 -9
  248. package/src/scripts/set-git-public.js +349 -7
  249. package/src/scripts/show-desktop-icons.js +459 -7
  250. package/src/scripts/show-hidden-files.js +456 -7
  251. package/src/scripts/tpa.js +265 -8
  252. package/src/scripts/tpo.js +264 -7
  253. package/src/scripts/u.js +489 -7
  254. package/src/scripts/vpush.js +422 -8
  255. package/src/scripts/y.js +267 -7
  256. package/src/utils/common/os.js +94 -2
  257. package/src/utils/ubuntu/apt.js +13 -7
  258. package/src/utils/windows/choco.js +82 -26
  259. package/src/utils/windows/winget.js +89 -27
@@ -1,44 +1,821 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * @fileoverview Install Studio 3T.
4
+ * @fileoverview Install Studio 3T - Professional IDE and GUI for MongoDB.
5
5
  * @module installs/studio-3t
6
+ *
7
+ * Studio 3T is a comprehensive MongoDB IDE that provides a visual query
8
+ * builder, IntelliShell with autocomplete, SQL query translation, aggregation
9
+ * editor, data import/export, schema explorer, and compare/sync features.
10
+ *
11
+ * This installer provides:
12
+ * - Homebrew cask installation for macOS (Intel and Apple Silicon)
13
+ * - Manual tarball installation for Ubuntu/Debian (x86-64 only)
14
+ * - Chocolatey-based installation for Windows
15
+ * - Manual tarball installation for Amazon Linux/RHEL (x86-64 only)
16
+ * - WSL support via Linux tarball installation (requires WSLg for GUI)
17
+ * - Git Bash support via Windows Chocolatey installation
18
+ *
19
+ * IMPORTANT PLATFORM NOTES:
20
+ * - macOS: Installs via Homebrew cask (supports Intel and Apple Silicon)
21
+ * - Windows: Installs via Chocolatey
22
+ * - Ubuntu/Debian: Manual tarball installation (no APT package available)
23
+ * - Amazon Linux/RHEL: Manual tarball installation (typically headless servers)
24
+ * - Raspberry Pi OS: NOT supported (ARM architecture incompatible)
25
+ * - WSL: Linux tarball installation (requires WSLg for GUI)
26
+ * - Git Bash: Installs on Windows host via Chocolatey
27
+ *
28
+ * NOTE: Studio 3T is built exclusively for x86-64 architecture on Linux.
29
+ * ARM-based systems (Raspberry Pi, AWS Graviton) are not supported.
6
30
  */
7
31
 
8
32
  const os = require('../utils/common/os');
33
+ const shell = require('../utils/common/shell');
34
+ const brew = require('../utils/macos/brew');
35
+ const macosApps = require('../utils/macos/apps');
36
+ const choco = require('../utils/windows/choco');
37
+
38
+ /**
39
+ * Whether this installer requires a desktop environment to function.
40
+ * Studio 3T is a GUI MongoDB IDE.
41
+ */
42
+ const REQUIRES_DESKTOP = true;
43
+
44
+ /**
45
+ * The Homebrew cask name for Studio 3T on macOS.
46
+ * @constant {string}
47
+ */
48
+ const HOMEBREW_CASK_NAME = 'studio-3t';
49
+
50
+ /**
51
+ * The Chocolatey package name for Studio 3T on Windows.
52
+ * @constant {string}
53
+ */
54
+ const CHOCO_PACKAGE_NAME = 'studio3t';
55
+
56
+ /**
57
+ * The macOS application name (as it appears in /Applications).
58
+ * @constant {string}
59
+ */
60
+ const MACOS_APP_NAME = 'Studio 3T';
61
+
62
+ /**
63
+ * The installation directory for Studio 3T on Linux.
64
+ * This is where the installer extracts Studio 3T by default.
65
+ * @constant {string}
66
+ */
67
+ const LINUX_INSTALL_DIR = '/opt/studio3t';
68
+
69
+ /**
70
+ * The Studio 3T executable path on Linux.
71
+ * @constant {string}
72
+ */
73
+ const LINUX_EXECUTABLE = '/opt/studio3t/Studio-3T';
74
+
75
+ /**
76
+ * The download URL for the Linux x64 tarball.
77
+ * NOTE: Version number may change - check https://studio3t.com/download/ for latest.
78
+ * @constant {string}
79
+ */
80
+ const LINUX_TARBALL_URL = 'https://download.studio3t.com/studio-3t/linux/2025.23.0/studio-3t-linux-x64.tar.gz';
81
+
82
+ /**
83
+ * Check if Studio 3T is installed on macOS by looking for the .app bundle.
84
+ *
85
+ * This is the most reliable method for detecting macOS GUI applications,
86
+ * as Studio 3T does not install a command-line entry point.
87
+ *
88
+ * @returns {boolean} True if Studio 3T.app exists, false otherwise
89
+ */
90
+ function isStudio3TInstalledMacOS() {
91
+ return macosApps.isAppInstalled(MACOS_APP_NAME);
92
+ }
93
+
94
+ /**
95
+ * Check if Studio 3T is installed on Linux via the tarball method.
96
+ *
97
+ * Looks for the Studio-3T executable in /opt/studio3t/ which is where
98
+ * the official installer extracts the application.
99
+ *
100
+ * @returns {Promise<boolean>} True if Studio 3T executable exists, false otherwise
101
+ */
102
+ async function isStudio3TInstalledLinux() {
103
+ const result = await shell.exec(`test -f "${LINUX_EXECUTABLE}"`);
104
+ return result.code === 0;
105
+ }
106
+
107
+ /**
108
+ * Install Studio 3T on macOS using Homebrew.
109
+ *
110
+ * Prerequisites:
111
+ * - macOS 10.15 (Catalina) or later
112
+ * - Homebrew package manager installed
113
+ * - At least 4 GB RAM
114
+ * - Intel processor or Apple Silicon (M1/M2/M3/M4)
115
+ *
116
+ * The installation uses the Homebrew cask 'studio-3t' which downloads and
117
+ * installs Studio 3T to /Applications/Studio 3T.app. Homebrew automatically
118
+ * selects the correct architecture build for your Mac.
119
+ *
120
+ * @returns {Promise<void>}
121
+ * @throws {Error} If Homebrew is not installed or installation fails
122
+ */
123
+ async function install_macos() {
124
+ console.log('Checking if Studio 3T is already installed...');
125
+
126
+ // Check if Studio 3T is already installed via the app bundle
127
+ if (isStudio3TInstalledMacOS()) {
128
+ const version = macosApps.getAppVersion(MACOS_APP_NAME);
129
+ if (version) {
130
+ console.log(`Studio 3T ${version} is already installed, skipping installation.`);
131
+ } else {
132
+ console.log('Studio 3T is already installed, skipping installation.');
133
+ }
134
+ return;
135
+ }
136
+
137
+ // Also check if the cask is installed (Studio 3T may be installed in a different location)
138
+ const caskInstalled = await brew.isCaskInstalled(HOMEBREW_CASK_NAME);
139
+ if (caskInstalled) {
140
+ console.log('Studio 3T is already installed via Homebrew, skipping installation.');
141
+ console.log('');
142
+ console.log('You can launch Studio 3T from Applications or run: open -a "Studio 3T"');
143
+ return;
144
+ }
145
+
146
+ // Verify Homebrew is available
147
+ if (!brew.isInstalled()) {
148
+ throw new Error(
149
+ 'Homebrew is not installed. Please install Homebrew first using:\n' +
150
+ ' dev install homebrew\n' +
151
+ 'Then retry installing Studio 3T.'
152
+ );
153
+ }
154
+
155
+ console.log('Installing Studio 3T via Homebrew...');
156
+ console.log('This may take a few minutes...');
157
+
158
+ // Install Studio 3T cask
159
+ const result = await brew.installCask(HOMEBREW_CASK_NAME);
160
+
161
+ if (!result.success) {
162
+ throw new Error(
163
+ `Failed to install Studio 3T via Homebrew.\n` +
164
+ `Output: ${result.output}\n\n` +
165
+ `Troubleshooting:\n` +
166
+ ` 1. Run 'brew update && brew cleanup' and retry\n` +
167
+ ` 2. Try manual installation: brew install --cask studio-3t`
168
+ );
169
+ }
170
+
171
+ // Verify installation succeeded
172
+ if (!isStudio3TInstalledMacOS()) {
173
+ throw new Error(
174
+ 'Installation appeared to complete but Studio 3T.app was not found in /Applications.\n' +
175
+ 'Please try reinstalling: brew reinstall --cask studio-3t'
176
+ );
177
+ }
178
+
179
+ console.log('Studio 3T installed successfully.');
180
+ console.log('');
181
+ console.log('You can launch Studio 3T from:');
182
+ console.log(' - Applications folder');
183
+ console.log(' - Command line: open -a "Studio 3T"');
184
+ console.log('');
185
+ console.log('NOTE: On first launch, Studio 3T will prompt you to accept the license');
186
+ console.log('agreement and optionally sign in. You can use Studio 3T Free for');
187
+ console.log('non-commercial purposes without an account.');
188
+ }
189
+
190
+ /**
191
+ * Install Studio 3T on Ubuntu/Debian using the official tarball.
192
+ *
193
+ * Prerequisites:
194
+ * - Ubuntu 22.04 LTS or later, or Debian 11 (Bullseye) or later
195
+ * - 64-bit x86-64 architecture ONLY (ARM is not supported)
196
+ * - sudo privileges
197
+ * - X11 or Wayland display server for GUI
198
+ * - At least 4 GB RAM
199
+ *
200
+ * IMPORTANT: Studio 3T is not available through APT repositories.
201
+ * It must be installed manually via the official tarball which includes
202
+ * a shell script installer supporting silent/non-interactive installation.
203
+ *
204
+ * @returns {Promise<void>}
205
+ * @throws {Error} If installation fails or architecture is unsupported
206
+ */
207
+ async function install_ubuntu() {
208
+ console.log('Checking if Studio 3T is already installed...');
209
+
210
+ // Check if already installed
211
+ const isInstalled = await isStudio3TInstalledLinux();
212
+ if (isInstalled) {
213
+ console.log('Studio 3T is already installed in /opt/studio3t, skipping installation.');
214
+ return;
215
+ }
216
+
217
+ // Check architecture - Studio 3T requires x86-64
218
+ const archResult = await shell.exec('uname -m');
219
+ const arch = archResult.stdout.trim();
220
+
221
+ if (arch !== 'x86_64') {
222
+ console.log(`Studio 3T requires x86-64 architecture.`);
223
+ console.log(`Your architecture is: ${arch}`);
224
+ console.log('');
225
+ console.log('Studio 3T is not available for ARM processors.');
226
+ return;
227
+ }
228
+
229
+ console.log('Installing Studio 3T for Linux (x86-64)...');
230
+ console.log('');
231
+
232
+ // Step 1: Download the tarball
233
+ console.log('Downloading Studio 3T...');
234
+ const downloadResult = await shell.exec(
235
+ `wget -q "${LINUX_TARBALL_URL}" -O /tmp/studio-3t-linux-x64.tar.gz`
236
+ );
237
+
238
+ if (downloadResult.code !== 0) {
239
+ throw new Error(
240
+ `Failed to download Studio 3T.\n` +
241
+ `Error: ${downloadResult.stderr}\n\n` +
242
+ `The download URL may have changed. Check:\n` +
243
+ ` https://studio3t.com/download/`
244
+ );
245
+ }
246
+
247
+ // Step 2: Extract the archive
248
+ console.log('Extracting archive...');
249
+ const extractResult = await shell.exec(
250
+ 'tar -xzf /tmp/studio-3t-linux-x64.tar.gz -C /tmp/'
251
+ );
252
+
253
+ if (extractResult.code !== 0) {
254
+ throw new Error(`Failed to extract Studio 3T archive: ${extractResult.stderr}`);
255
+ }
256
+
257
+ // Step 3: Run the installer in quiet/non-interactive mode
258
+ console.log('Running installer (this may take a moment)...');
259
+ const installResult = await shell.exec(
260
+ 'sudo /tmp/studio-3t-linux-x64.sh -q'
261
+ );
262
+
263
+ if (installResult.code !== 0) {
264
+ throw new Error(
265
+ `Failed to run Studio 3T installer.\n` +
266
+ `Error: ${installResult.stderr}\n\n` +
267
+ `Troubleshooting:\n` +
268
+ ` 1. Ensure you have sudo privileges\n` +
269
+ ` 2. Try running manually: sudo /tmp/studio-3t-linux-x64.sh -q`
270
+ );
271
+ }
272
+
273
+ // Step 4: Clean up downloaded files
274
+ console.log('Cleaning up...');
275
+ await shell.exec('rm -f /tmp/studio-3t-linux-x64.tar.gz /tmp/studio-3t-linux-x64.sh');
276
+
277
+ // Verify installation
278
+ const verified = await isStudio3TInstalledLinux();
279
+ if (!verified) {
280
+ throw new Error(
281
+ 'Installation appeared to complete but Studio 3T was not found.\n' +
282
+ 'Please check /opt/studio3t/ for the installation.'
283
+ );
284
+ }
285
+
286
+ console.log('Studio 3T installed successfully.');
287
+ console.log('');
288
+ console.log('Launch Studio 3T with:');
289
+ console.log(' /opt/studio3t/Studio-3T &');
290
+ console.log('');
291
+ console.log('If you encounter shared library errors, install dependencies with:');
292
+ console.log(' sudo apt-get install -y libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 libatspi2.0-0 libsecret-1-0');
293
+ }
294
+
295
+ /**
296
+ * Install Studio 3T on Raspberry Pi OS.
297
+ *
298
+ * CRITICAL LIMITATION: Studio 3T does NOT support ARM architecture.
299
+ * The application is built exclusively for x86-64 (Intel/AMD) processors.
300
+ * There is no ARM build available for Raspberry Pi, and attempting to
301
+ * run the x86-64 binary will fail.
302
+ *
303
+ * This function returns gracefully with a message explaining the limitation.
304
+ *
305
+ * @returns {Promise<void>}
306
+ */
307
+ async function install_raspbian() {
308
+ console.log('Studio 3T is not available for Raspberry Pi OS.');
309
+ console.log('');
310
+ console.log('Studio 3T requires x86-64 (Intel/AMD) architecture and does not');
311
+ console.log('support ARM processors used by Raspberry Pi.');
312
+ }
313
+
314
+ /**
315
+ * Install Studio 3T on Amazon Linux/RHEL using the official tarball.
316
+ *
317
+ * Prerequisites:
318
+ * - Amazon Linux 2023, Amazon Linux 2, RHEL 8, or later
319
+ * - 64-bit x86-64 architecture ONLY (Graviton ARM instances not supported)
320
+ * - sudo privileges
321
+ * - X11 display server for GUI (typically not available on EC2 instances)
322
+ * - At least 4 GB RAM
323
+ *
324
+ * IMPORTANT: Amazon Linux EC2 instances typically run headless (no GUI).
325
+ * Studio 3T is a graphical application and requires a display. For headless
326
+ * server environments, use X11 forwarding or access MongoDB through
327
+ * command-line tools like mongosh.
328
+ *
329
+ * @returns {Promise<void>}
330
+ * @throws {Error} If installation fails or architecture is unsupported
331
+ */
332
+ async function install_amazon_linux() {
333
+ console.log('Checking if Studio 3T is already installed...');
334
+
335
+ // Check if already installed
336
+ const isInstalled = await isStudio3TInstalledLinux();
337
+ if (isInstalled) {
338
+ console.log('Studio 3T is already installed in /opt/studio3t, skipping installation.');
339
+ return;
340
+ }
341
+
342
+ // Check architecture - Studio 3T requires x86-64
343
+ const archResult = await shell.exec('uname -m');
344
+ const arch = archResult.stdout.trim();
345
+
346
+ if (arch !== 'x86_64') {
347
+ console.log(`Studio 3T requires x86-64 architecture.`);
348
+ console.log(`Your architecture is: ${arch}`);
349
+ console.log('');
350
+ console.log('Studio 3T is not available for ARM processors (AWS Graviton).');
351
+ return;
352
+ }
353
+
354
+ console.log('Installing Studio 3T for Linux (x86-64)...');
355
+ console.log('');
356
+ console.log('NOTE: Studio 3T is a GUI application. If you are running on a');
357
+ console.log('headless server, you will need X11 forwarding to launch it.');
358
+ console.log('');
359
+
360
+ // Step 1: Install required dependencies
361
+ console.log('Installing dependencies...');
362
+
363
+ // Detect package manager (dnf for Amazon Linux 2023, yum for Amazon Linux 2)
364
+ const hasDnf = shell.commandExists('dnf');
365
+ const pkgManager = hasDnf ? 'dnf' : 'yum';
366
+
367
+ const depsResult = await shell.exec(
368
+ `sudo ${pkgManager} install -y wget tar gzip gtk3 libnotify nss libXScrnSaver libXtst at-spi2-core libsecret`
369
+ );
370
+
371
+ if (depsResult.code !== 0) {
372
+ console.log('Warning: Some dependencies may not have installed correctly.');
373
+ console.log('Continuing with installation...');
374
+ }
375
+
376
+ // Step 2: Download the tarball
377
+ console.log('Downloading Studio 3T...');
378
+ const downloadResult = await shell.exec(
379
+ `wget -q "${LINUX_TARBALL_URL}" -O /tmp/studio-3t-linux-x64.tar.gz`
380
+ );
381
+
382
+ if (downloadResult.code !== 0) {
383
+ throw new Error(
384
+ `Failed to download Studio 3T.\n` +
385
+ `Error: ${downloadResult.stderr}\n\n` +
386
+ `The download URL may have changed. Check:\n` +
387
+ ` https://studio3t.com/download/`
388
+ );
389
+ }
390
+
391
+ // Step 3: Extract the archive
392
+ console.log('Extracting archive...');
393
+ const extractResult = await shell.exec(
394
+ 'tar -xzf /tmp/studio-3t-linux-x64.tar.gz -C /tmp/'
395
+ );
396
+
397
+ if (extractResult.code !== 0) {
398
+ throw new Error(`Failed to extract Studio 3T archive: ${extractResult.stderr}`);
399
+ }
400
+
401
+ // Step 4: Run the installer in quiet/non-interactive mode
402
+ console.log('Running installer (this may take a moment)...');
403
+ const installResult = await shell.exec(
404
+ 'sudo /tmp/studio-3t-linux-x64.sh -q'
405
+ );
406
+
407
+ if (installResult.code !== 0) {
408
+ throw new Error(
409
+ `Failed to run Studio 3T installer.\n` +
410
+ `Error: ${installResult.stderr}\n\n` +
411
+ `Troubleshooting:\n` +
412
+ ` 1. Ensure you have sudo privileges\n` +
413
+ ` 2. Try running manually: sudo /tmp/studio-3t-linux-x64.sh -q`
414
+ );
415
+ }
416
+
417
+ // Step 5: Clean up downloaded files
418
+ console.log('Cleaning up...');
419
+ await shell.exec('rm -f /tmp/studio-3t-linux-x64.tar.gz /tmp/studio-3t-linux-x64.sh');
420
+
421
+ // Verify installation
422
+ const verified = await isStudio3TInstalledLinux();
423
+ if (!verified) {
424
+ throw new Error(
425
+ 'Installation appeared to complete but Studio 3T was not found.\n' +
426
+ 'Please check /opt/studio3t/ for the installation.'
427
+ );
428
+ }
429
+
430
+ console.log('Studio 3T installed successfully.');
431
+ console.log('');
432
+ console.log('For X11-forwarded sessions, launch Studio 3T with:');
433
+ console.log(' /opt/studio3t/Studio-3T &');
434
+ console.log('');
435
+ console.log('To connect via SSH with X11 forwarding:');
436
+ console.log(' ssh -X user@your-server');
437
+ }
438
+
439
+ /**
440
+ * Install Studio 3T on Windows using Chocolatey.
441
+ *
442
+ * Prerequisites:
443
+ * - Windows 10 version 21H2 or higher (64-bit), or Windows 11
444
+ * - At least 4 GB RAM
445
+ * - Administrator PowerShell or Command Prompt
446
+ * - Chocolatey package manager installed
447
+ *
448
+ * The installation uses the 'studio3t' Chocolatey package which downloads
449
+ * the official Studio 3T installer and configures the application.
450
+ *
451
+ * @returns {Promise<void>}
452
+ * @throws {Error} If Chocolatey is not installed or installation fails
453
+ */
454
+ async function install_windows() {
455
+ console.log('Checking if Studio 3T is already installed...');
456
+
457
+ // Check if Studio 3T is installed via Chocolatey
458
+ const packageInstalled = await choco.isPackageInstalled(CHOCO_PACKAGE_NAME);
459
+ if (packageInstalled) {
460
+ const version = await choco.getPackageVersion(CHOCO_PACKAGE_NAME);
461
+ if (version) {
462
+ console.log(`Studio 3T ${version} is already installed via Chocolatey, skipping installation.`);
463
+ } else {
464
+ console.log('Studio 3T is already installed via Chocolatey, skipping installation.');
465
+ }
466
+ return;
467
+ }
468
+
469
+ // Verify Chocolatey is available
470
+ if (!choco.isInstalled()) {
471
+ throw new Error(
472
+ 'Chocolatey is not installed. Please install Chocolatey first:\n\n' +
473
+ 'Run the following in an Administrator PowerShell:\n' +
474
+ ' Set-ExecutionPolicy Bypass -Scope Process -Force; ' +
475
+ '[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; ' +
476
+ 'iex ((New-Object System.Net.WebClient).DownloadString(\'https://community.chocolatey.org/install.ps1\'))\n\n' +
477
+ 'Then retry installing Studio 3T.'
478
+ );
479
+ }
480
+
481
+ console.log('Installing Studio 3T via Chocolatey...');
482
+ console.log('This may take a few minutes...');
483
+
484
+ // Install Studio 3T
485
+ const result = await choco.install(CHOCO_PACKAGE_NAME);
486
+
487
+ if (!result.success) {
488
+ throw new Error(
489
+ `Failed to install Studio 3T via Chocolatey.\n` +
490
+ `Output: ${result.output}\n\n` +
491
+ `Troubleshooting:\n` +
492
+ ` 1. Ensure you are running as Administrator\n` +
493
+ ` 2. Try: choco install studio3t -y\n` +
494
+ ` 3. Check Windows Defender is not blocking the installation`
495
+ );
496
+ }
497
+
498
+ // Verify installation
499
+ const installed = await choco.isPackageInstalled(CHOCO_PACKAGE_NAME);
500
+ if (!installed) {
501
+ throw new Error(
502
+ 'Installation appeared to complete but Studio 3T was not found.\n' +
503
+ 'Please try: choco install studio3t -y'
504
+ );
505
+ }
506
+
507
+ const version = await choco.getPackageVersion(CHOCO_PACKAGE_NAME);
508
+ console.log(`Studio 3T ${version || ''} installed successfully.`);
509
+ console.log('');
510
+ console.log('Launch Studio 3T from:');
511
+ console.log(' - Start Menu');
512
+ console.log(' - Command line: studio3t');
513
+ console.log('');
514
+ console.log('NOTE: On first launch, Studio 3T will prompt you to accept the license');
515
+ console.log('agreement and optionally sign in. You can use Studio 3T Free for');
516
+ console.log('non-commercial purposes without an account.');
517
+ }
518
+
519
+ /**
520
+ * Install Studio 3T on Ubuntu running in WSL (Windows Subsystem for Linux).
521
+ *
522
+ * Prerequisites:
523
+ * - Windows 10 version 2004 or higher, or Windows 11
524
+ * - WSL 2 enabled with Ubuntu distribution installed
525
+ * - WSLg enabled (Windows 11 or Windows 10 build 21364+) for GUI support
526
+ * - sudo privileges within WSL
527
+ * - x86-64 architecture (ARM64 Windows not supported)
528
+ *
529
+ * NOTE: Running GUI applications in WSL requires WSLg. Without WSLg,
530
+ * you cannot run Studio 3T's graphical interface in WSL. The installation
531
+ * follows the same tarball method as Ubuntu.
532
+ *
533
+ * @returns {Promise<void>}
534
+ * @throws {Error} If installation fails
535
+ */
536
+ async function install_ubuntu_wsl() {
537
+ console.log('Detected Ubuntu running in WSL (Windows Subsystem for Linux).');
538
+ console.log('');
539
+
540
+ // Check if already installed
541
+ const isInstalled = await isStudio3TInstalledLinux();
542
+ if (isInstalled) {
543
+ console.log('Studio 3T is already installed in /opt/studio3t, skipping installation.');
544
+ return;
545
+ }
546
+
547
+ // Check if WSLg is available (DISPLAY environment variable)
548
+ const display = process.env.DISPLAY;
549
+ if (!display) {
550
+ console.log('WARNING: WSLg does not appear to be available ($DISPLAY is not set).');
551
+ console.log('Studio 3T requires a graphical display to run.');
552
+ console.log('');
553
+ console.log('Options:');
554
+ console.log(' 1. Update Windows to a version that supports WSLg');
555
+ console.log(' 2. Install Studio 3T on Windows and use it directly');
556
+ console.log('');
557
+ }
558
+
559
+ // Check architecture - Studio 3T requires x86-64
560
+ const archResult = await shell.exec('uname -m');
561
+ const arch = archResult.stdout.trim();
562
+
563
+ if (arch !== 'x86_64') {
564
+ console.log(`Studio 3T requires x86-64 architecture.`);
565
+ console.log(`Your architecture is: ${arch}`);
566
+ console.log('');
567
+ console.log('Studio 3T is not available for ARM processors.');
568
+ return;
569
+ }
570
+
571
+ console.log('Installing Studio 3T for Linux (x86-64) in WSL...');
572
+ console.log('');
573
+
574
+ // Step 1: Download the tarball
575
+ console.log('Downloading Studio 3T...');
576
+ const downloadResult = await shell.exec(
577
+ `wget -q "${LINUX_TARBALL_URL}" -O /tmp/studio-3t-linux-x64.tar.gz`
578
+ );
579
+
580
+ if (downloadResult.code !== 0) {
581
+ throw new Error(
582
+ `Failed to download Studio 3T.\n` +
583
+ `Error: ${downloadResult.stderr}\n\n` +
584
+ `The download URL may have changed. Check:\n` +
585
+ ` https://studio3t.com/download/`
586
+ );
587
+ }
588
+
589
+ // Step 2: Extract the archive
590
+ console.log('Extracting archive...');
591
+ const extractResult = await shell.exec(
592
+ 'tar -xzf /tmp/studio-3t-linux-x64.tar.gz -C /tmp/'
593
+ );
594
+
595
+ if (extractResult.code !== 0) {
596
+ throw new Error(`Failed to extract Studio 3T archive: ${extractResult.stderr}`);
597
+ }
598
+
599
+ // Step 3: Run the installer in quiet/non-interactive mode
600
+ console.log('Running installer (this may take a moment)...');
601
+ const installResult = await shell.exec(
602
+ 'sudo /tmp/studio-3t-linux-x64.sh -q'
603
+ );
604
+
605
+ if (installResult.code !== 0) {
606
+ throw new Error(
607
+ `Failed to run Studio 3T installer.\n` +
608
+ `Error: ${installResult.stderr}\n\n` +
609
+ `Troubleshooting:\n` +
610
+ ` 1. Ensure you have sudo privileges\n` +
611
+ ` 2. Try running manually: sudo /tmp/studio-3t-linux-x64.sh -q`
612
+ );
613
+ }
614
+
615
+ // Step 4: Clean up downloaded files
616
+ console.log('Cleaning up...');
617
+ await shell.exec('rm -f /tmp/studio-3t-linux-x64.tar.gz /tmp/studio-3t-linux-x64.sh');
618
+
619
+ // Verify installation
620
+ const verified = await isStudio3TInstalledLinux();
621
+ if (!verified) {
622
+ throw new Error(
623
+ 'Installation appeared to complete but Studio 3T was not found.\n' +
624
+ 'Please check /opt/studio3t/ for the installation.'
625
+ );
626
+ }
627
+
628
+ console.log('Studio 3T installed successfully.');
629
+ console.log('');
630
+ console.log('Launch Studio 3T with:');
631
+ console.log(' /opt/studio3t/Studio-3T &');
632
+ console.log('');
633
+ console.log('IMPORTANT for WSL users:');
634
+ console.log(' - Studio 3T requires WSLg for GUI support');
635
+ console.log(' - If you see display errors, check that $DISPLAY is set');
636
+ console.log(' - For rendering issues, try: LIBGL_ALWAYS_SOFTWARE=1 /opt/studio3t/Studio-3T &');
637
+ }
9
638
 
10
639
  /**
11
- * Install Studio 3T across supported platforms.
640
+ * Install Studio 3T from Git Bash on Windows.
641
+ *
642
+ * Git Bash runs within Windows, so this function installs Studio 3T
643
+ * on the Windows host using Chocolatey via PowerShell interop.
644
+ *
645
+ * Prerequisites:
646
+ * - Windows 10 or Windows 11 (64-bit)
647
+ * - Git Bash installed (comes with Git for Windows)
648
+ * - Chocolatey package manager installed on Windows
649
+ * - Administrator privileges
650
+ *
651
+ * @returns {Promise<void>}
652
+ * @throws {Error} If installation fails
653
+ */
654
+ async function install_gitbash() {
655
+ console.log('Detected Git Bash on Windows.');
656
+ console.log('Installing Studio 3T on the Windows host...');
657
+ console.log('');
658
+
659
+ // Check if Studio 3T is already installed via Chocolatey
660
+ const checkResult = await shell.exec(
661
+ 'powershell.exe -NoProfile -Command "choco list --local-only --exact studio3t"'
662
+ );
663
+ if (checkResult.code === 0 && checkResult.stdout.toLowerCase().includes('studio3t')) {
664
+ console.log('Studio 3T is already installed via Chocolatey, skipping installation.');
665
+ console.log('');
666
+ console.log('Launch Studio 3T from the Windows Start Menu.');
667
+ return;
668
+ }
669
+
670
+ // Check if Chocolatey is available
671
+ const chocoCheck = await shell.exec('powershell.exe -NoProfile -Command "choco --version"');
672
+ if (chocoCheck.code !== 0) {
673
+ throw new Error(
674
+ 'Chocolatey is not installed on Windows.\n\n' +
675
+ 'Install Chocolatey by running the following in an Administrator PowerShell:\n' +
676
+ ' Set-ExecutionPolicy Bypass -Scope Process -Force; ' +
677
+ '[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; ' +
678
+ 'iex ((New-Object System.Net.WebClient).DownloadString(\'https://community.chocolatey.org/install.ps1\'))\n\n' +
679
+ 'Then retry installing Studio 3T.'
680
+ );
681
+ }
682
+
683
+ console.log('Installing Studio 3T via Chocolatey...');
684
+ console.log('This may take a few minutes...');
685
+
686
+ // Install via PowerShell using Chocolatey
687
+ const installResult = await shell.exec(
688
+ 'powershell.exe -NoProfile -Command "choco install studio3t -y"'
689
+ );
690
+
691
+ if (installResult.code !== 0) {
692
+ throw new Error(
693
+ `Failed to install Studio 3T.\n` +
694
+ `Output: ${installResult.stdout || installResult.stderr}\n\n` +
695
+ `Troubleshooting:\n` +
696
+ ` 1. Ensure Chocolatey is installed on Windows\n` +
697
+ ` 2. Run Git Bash as Administrator and retry\n` +
698
+ ` 3. Try installing directly from PowerShell: choco install studio3t -y`
699
+ );
700
+ }
701
+
702
+ console.log('Studio 3T installed successfully.');
703
+ console.log('');
704
+ console.log('Launch Studio 3T from:');
705
+ console.log(' - Windows Start Menu');
706
+ console.log(' - Git Bash: start studio3t');
707
+ }
708
+
709
+ /**
710
+ * Check if Studio 3T is installed on the current platform.
711
+ *
712
+ * This function performs platform-specific checks to determine if Studio 3T
713
+ * is already installed on the system.
714
+ *
715
+ * @returns {Promise<boolean>} True if Studio 3T is installed, false otherwise
716
+ */
717
+ async function isInstalled() {
718
+ const platform = os.detect();
719
+
720
+ if (platform.type === 'macos') {
721
+ return isStudio3TInstalledMacOS();
722
+ }
723
+
724
+ if (platform.type === 'windows' || platform.type === 'gitbash') {
725
+ return choco.isPackageInstalled(CHOCO_PACKAGE_NAME);
726
+ }
727
+
728
+ if (['ubuntu', 'debian', 'wsl', 'amazon_linux', 'rhel', 'fedora'].includes(platform.type)) {
729
+ return isStudio3TInstalledLinux();
730
+ }
731
+
732
+ // Raspberry Pi is not supported
733
+ return false;
734
+ }
735
+
736
+ /**
737
+ * Check if this installer is supported on the current platform.
738
+ * Studio 3T is not available for Raspberry Pi (ARM architecture not supported).
739
+ * @returns {boolean} True if installation is supported on this platform
740
+ */
741
+ function isEligible() {
742
+ const platform = os.detect();
743
+ const supportedPlatforms = ['macos', 'ubuntu', 'debian', 'wsl', 'amazon_linux', 'rhel', 'fedora', 'windows', 'gitbash'];
744
+ if (!supportedPlatforms.includes(platform.type)) {
745
+ return false;
746
+ }
747
+ if (REQUIRES_DESKTOP && !os.isDesktopAvailable()) {
748
+ return false;
749
+ }
750
+ return true;
751
+ }
752
+
753
+ /**
754
+ * Main installation entry point.
755
+ *
756
+ * Detects the current platform and runs the appropriate installer function.
757
+ * Handles platform-specific mappings to ensure all supported platforms
758
+ * have appropriate installation logic.
759
+ *
760
+ * Supported platforms:
761
+ * - macOS: Studio 3T via Homebrew cask
762
+ * - Ubuntu/Debian: Studio 3T via official tarball
763
+ * - Amazon Linux/RHEL: Studio 3T via official tarball
764
+ * - Windows: Studio 3T via Chocolatey
765
+ * - WSL (Ubuntu): Studio 3T via official tarball (requires WSLg)
766
+ * - Git Bash: Studio 3T on Windows host via Chocolatey
767
+ *
768
+ * Unsupported platforms:
769
+ * - Raspberry Pi OS: ARM architecture not supported
12
770
  *
13
771
  * @returns {Promise<void>}
14
772
  */
15
773
  async function install() {
16
774
  const platform = os.detect();
17
775
 
18
- switch (platform.type) {
19
- case 'macos':
20
- // TODO: Implement macOS installation
21
- break;
22
- case 'debian':
23
- // TODO: Implement Debian/Ubuntu installation
24
- break;
25
- case 'rhel':
26
- // TODO: Implement RHEL/Amazon Linux installation
27
- break;
28
- case 'windows-wsl':
29
- // TODO: Implement WSL installation
30
- break;
31
- case 'windows':
32
- // TODO: Implement Windows installation
33
- break;
34
- default:
35
- console.error(`Unsupported platform: ${platform.type}`);
36
- process.exit(1);
37
- }
38
- }
39
-
40
- module.exports = { install };
776
+ // Map platform types to their installer functions
777
+ const installers = {
778
+ 'macos': install_macos,
779
+ 'ubuntu': install_ubuntu,
780
+ 'debian': install_ubuntu,
781
+ 'wsl': install_ubuntu_wsl,
782
+ 'raspbian': install_raspbian,
783
+ 'amazon_linux': install_amazon_linux,
784
+ 'rhel': install_amazon_linux,
785
+ 'fedora': install_amazon_linux,
786
+ 'windows': install_windows,
787
+ 'gitbash': install_gitbash
788
+ };
789
+
790
+ const installer = installers[platform.type];
791
+
792
+ if (!installer) {
793
+ console.log(`Studio 3T is not available for ${platform.type}.`);
794
+ return;
795
+ }
796
+
797
+ await installer();
798
+ }
799
+
800
+ // Export all functions for use as a module and for testing
801
+ module.exports = {
802
+ REQUIRES_DESKTOP,
803
+ install,
804
+ isInstalled,
805
+ isEligible,
806
+ install_macos,
807
+ install_ubuntu,
808
+ install_ubuntu_wsl,
809
+ install_raspbian,
810
+ install_amazon_linux,
811
+ install_windows,
812
+ install_gitbash
813
+ };
41
814
 
815
+ // Allow direct execution: node studio-3t.js
42
816
  if (require.main === module) {
43
- install();
817
+ install().catch(err => {
818
+ console.error(err.message);
819
+ process.exit(1);
820
+ });
44
821
  }