Skip to content

Commit

Permalink
mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
neolao committed Feb 23, 2020
1 parent c8a8fbe commit 4cb03ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"scripts": {
"start": "webpack --mode production && electron .",
"pack-mac": "npm run build && electron-builder --mac --x64",
"pack-windows": "npm run build && electron-builder --win --x64",
"pack-windows:dev": "npm run build && electron-builder --dir --win --x64",
"postinstall": "electron-builder install-app-deps",
Expand Down
14 changes: 12 additions & 2 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ if (remote.process.argv.length >= 3) {
} else if (isDev) {
currentDirectory = path.resolve(app.getAppPath(), "dev-env");
} else {
currentDirectory = remote.process.env.PORTABLE_EXECUTABLE_DIR;
if (remote.process.env.PORTABLE_EXECUTABLE_DIR) {
currentDirectory = remote.process.env.PORTABLE_EXECUTABLE_DIR;
} else if (remote.process.env.INIT_CWD) {
currentDirectory = remote.process.env.INIT_CWD;
} else if (app.getPath("exe")) {
currentDirectory = path.dirname(app.getPath("exe"));
} else if (remote.process.execPath) {
currentDirectory = remote.process.execPath;
}
}
if (path.basename(currentDirectory) === "MacOS") {
currentDirectory = path.resolve(currentDirectory, "..", "..", "..");
}

const Wrapper = styled.main`
Expand Down Expand Up @@ -56,7 +67,6 @@ const Versus = styled.img`
`;

export default function App() {

if (!currentDirectory) {
return (
<Requirement>
Expand Down

0 comments on commit 4cb03ba

Please sign in to comment.