Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ The important parts of the project are the following:
To **set up your environment** to develop this tool, run:

- `npm install`
- `node index`
- `bun index.js`

You can also run `node index DEV=true CLIENT_ID=<YOUR_TESTING_CLIENT_ID>` if you want to use your own client id for development and testing purposes.
You can also run `DEV=true CLIENT_ID=<YOUR_TESTING_CLIENT_ID> bun index.js` if you want to use your own client id for development and testing purposes.

All the tests are written with [mocha](https://mochajs.org/) and can be run with `npm test`.

Expand Down
27 changes: 17 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
#!/usr/bin/env node
#!/usr/bin/env bun

import Config from './src/config.js';
import Github from './src/github.js';
import UI from './src/ui.js';
const isBunRuntime = typeof Bun !== 'undefined' || Boolean(process.versions?.bun);

import reposCommand from './src/commands/repos.js';
import codespacesCommand from './src/commands/codespaces.js';

UI.printWelcome();
if (!isBunRuntime) {
console.error('OpenTUI requires Bun. Please run this command with bun.');
process.exit(1);
}

const main = async () => {
const [{ default: Config }, { default: Github }, { default: UI }, { default: reposCommand }, { default: codespacesCommand }] =
await Promise.all([
import('./src/config.js'),
import('./src/github.js'),
import('./src/ui.js'),
import('./src/commands/repos.js'),
import('./src/commands/codespaces.js'),
]);

UI.printWelcome();

try {
if (!Config.load()) {
const token = await UI.promptAuth();
Expand All @@ -35,7 +44,6 @@ const main = async () => {
break;
default:
if (!command) {
// await reposCommand();
UI.printHelp();
break;
}
Expand All @@ -49,7 +57,6 @@ const main = async () => {
}

UI.printError(error);
return;
}
};

Expand Down
Loading
Loading