-
Notifications
You must be signed in to change notification settings - Fork 0
Add explicit path for dotenv #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,20 @@ | ||
| import prepareFiles from './cli/readWrite.js'; | ||
| import cleanUp from './utils/index.js'; | ||
| // import cleanUp from './utils/index.js'; | ||
| import { processOneUser } from './core/batchProcessor.js' | ||
| // import octokit from './api/githubClient.js'; | ||
| import octokit from './api/githubClient.js'; | ||
|
|
||
| const myoc = octokit; | ||
|
|
||
| const username = 'Nostromos'; | ||
|
|
||
| // Example usage of octokit to fetch user details | ||
| (async () => { | ||
| try { | ||
| const { data } = await myoc.rest.users.getByUsername({ username }); | ||
| console.log(`Fetched user details for ${username}:`, data); | ||
| } catch (error) { | ||
| console.error(`Failed to fetch user details for ${username}:`, error); | ||
| try { | ||
| const { data } = await octokit.rest.users.getAuthenticated(); | ||
|
||
| console.log(`✅ Authenticated as ${data.login}`); | ||
| } catch (error: unknown) { | ||
| if (error instanceof Error) { | ||
| console.error("❌ Authentication failed:", error.message); | ||
| } else { | ||
| console.error("❌ Authentication failed:", error); | ||
| } | ||
| })(); | ||
| } | ||
| const username = 'Nostromos'; | ||
|
|
||
| try { | ||
| console.log(`Preparing files...`); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using path.join or path.resolve (with __dirname) to construct the .env file path for OS-independent path resolution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. For now, I'll leave it as is but will create an issue for this to ensure I tackle it eventually.