Skip to content

Commit 9da9ed9

Browse files
jerome-benoitTest User
andauthored
fix(nix): relax Bun version check for desktop build (anomalyco#36767)
Co-authored-by: Test User <test@test.com>
1 parent fab2133 commit 9da9ed9

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

nix/desktop.nix

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,23 @@ stdenv.mkDerivation (finalAttrs: {
4242
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
4343
};
4444

45-
# https://github.com/electron/electron/issues/31121
46-
# mac builds use a .app bundle which doesnt have this issue
47-
postPatch = lib.optionalString stdenv.isLinux ''
48-
BASE_PATH=packages/desktop
49-
FILES=(src/main/windows.ts)
50-
for file in "''${FILES[@]}"; do
51-
substituteInPlace $BASE_PATH/$file \
52-
--replace-fail "process.resourcesPath" "'$out/opt/opencode-desktop/resources'"
53-
done
54-
'';
45+
postPatch =
46+
# NOTE: Relax Bun version check to be a warning instead of an error
47+
''
48+
substituteInPlace packages/script/src/index.ts \
49+
--replace-fail 'throw new Error(`This script requires bun@''${expectedBunVersionRange}' \
50+
'console.warn(`Warning: This script requires bun@''${expectedBunVersionRange}'
51+
''
52+
# https://github.com/electron/electron/issues/31121
53+
# mac builds use a .app bundle which doesnt have this issue
54+
+ lib.optionalString stdenv.isLinux ''
55+
BASE_PATH=packages/desktop
56+
FILES=(src/main/windows.ts)
57+
for file in "''${FILES[@]}"; do
58+
substituteInPlace $BASE_PATH/$file \
59+
--replace-fail "process.resourcesPath" "'$out/opt/opencode-desktop/resources'"
60+
done
61+
'';
5562

5663
preBuild = ''
5764
cp -r "${electron.dist}" $HOME/.electron-dist

0 commit comments

Comments
 (0)