Skip to content

Commit

Permalink
save for npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
yixin0909 zhang authored and yixin0909 zhang committed Jun 5, 2024
1 parent 1d9b897 commit 32fe5f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,23 @@ openai.baseURL = "https://api.aiproxy.io/v1"
yarn start

```

### Turn it into an .app with Electron

Want to create an .app executable instead of running this from your terminal?

First go to `index.js` and change `const useElectronPackager` from `false` to `true`.

Run one of these in your terminal, depending on which platform you're on.

```bash
npm run package-mac
npm run package-win
npm run package-linux
```

Note I have only tested this on Mac (Apple silicon and Intel).

Go to `/release-builds/` in your project folder, and chose the folder of your platform. In there is an executable, `.app` if you're on Mac. Double-click it to open the app, note that it may take a few seconds the first time so be patient.

Once the app is opened, trigger your keyboard shortcut. You'll be asked to grant Privacy & Security permissions. You may need to repeat this another one or two times for all permissions to work properly, and to restart the app.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fs.readFile(conversationHistoryPath, 'utf8', (err, data) => {


// Set to true if you intend to package the app, otherwise false.
const useElectronPackager = false;
const useElectronPackager = true;
let tempFilesDir;
// This decides what directory/storage strategy to use (local project or application folder)
if (useElectronPackager) {
Expand Down

0 comments on commit 32fe5f4

Please sign in to comment.