Skip to content

Commit

Permalink
fix show me where links (Jigsaw-Code#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevj authored Aug 8, 2018
1 parent 2064a53 commit 0f9f257
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/server_manager/electron_app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const shell = electron.shell;

const debugMode = process.env.OUTLINE_DEBUG === 'true';

const IMAGES_URL = `file://${path.join(__dirname, 'server_manager', 'web_app')}`;
const IMAGES_BASENAME =
`${path.join(__dirname.replace('app.asar', 'app.asar.unpacked'), 'server_manager', 'web_app')}`;

interface IpcEvent {
returnValue: {};
Expand Down Expand Up @@ -186,12 +187,10 @@ function main() {
});

ipcMain.on('open-image', (event: IpcEvent, args: string[]) => {
if (!args || args.length === 0) {
console.error('open-image event received no image path.');
return;
const p = path.join(IMAGES_BASENAME, args[0]);
if (!shell.openItem(p)) {
console.error(`could not open image at ${p}`);
}
const imagePath = args[0];
shell.openExternal(path.join(IMAGES_URL, imagePath));
});

app.on('activate', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/server_manager/electron_app/package_linux_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ yarn do server_manager/electron_app/build
# https://github.com/electron-userland/electron-builder/issues/2498
$ROOT_DIR/src/server_manager/node_modules/.bin/electron-builder \
--projectDir=build/server_manager/electron_app/static \
--config.asarUnpack=server_manager/web_app/images \
--publish=never \
--config.publish.provider=generic \
--config.publish.url=https://raw.githubusercontent.com/Jigsaw-Code/outline-releases/master/manager/ \
Expand All @@ -32,6 +33,7 @@ $ROOT_DIR/src/server_manager/node_modules/.bin/electron-builder \
for arch in ia32 x64; do
$ROOT_DIR/src/server_manager/node_modules/.bin/electron-builder \
--projectDir=build/server_manager/electron_app/static \
--config.asarUnpack=server_manager/web_app/images \
--publish=never \
--$arch \
--linux deb rpm tar.gz \
Expand Down
1 change: 1 addition & 0 deletions src/server_manager/electron_app/package_macos_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ yarn do server_manager/electron_app/build
# Produces dmg and zip images. The latter is required for auto-update.
$ROOT_DIR/src/server_manager/node_modules/.bin/electron-builder \
--projectDir=build/server_manager/electron_app/static \
--config.asarUnpack=server_manager/web_app/images \
--publish=never \
--config.publish.provider=generic \
--config.publish.url=https://raw.githubusercontent.com/Jigsaw-Code/outline-releases/master/manager/ \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

$ROOT_DIR/src/server_manager/node_modules/.bin/electron-builder \
--projectDir=build/server_manager/electron_app/static \
--config.asarUnpack=server_manager/web_app/images \
--publish=never \
--config.publish.provider=generic \
--config.publish.url=https://raw.githubusercontent.com/Jigsaw-Code/outline-releases/master/manager/ \
Expand Down
1 change: 1 addition & 0 deletions src/server_manager/electron_app/release_windows_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ yarn do server_manager/electron_app/build

$ROOT_DIR/src/server_manager/node_modules/.bin/electron-builder \
--projectDir=build/server_manager/electron_app/static \
--config.asarUnpack=server_manager/web_app/images \
--publish=never \
--config.publish.provider=generic \
--config.publish.url=https://raw.githubusercontent.com/Jigsaw-Code/outline-releases/master/manager/ \
Expand Down

0 comments on commit 0f9f257

Please sign in to comment.