Skip to content
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

Troubleshooting running echo command on Windows #67

Closed
AntoineKM opened this issue Feb 16, 2023 · 3 comments
Closed

Troubleshooting running echo command on Windows #67

AntoineKM opened this issue Feb 16, 2023 · 3 comments

Comments

@AntoineKM
Copy link

Hi, I am making this issue to guide people who encounter the same problem as me on Windows.

Be careful while following the README.md command:

echo "OPENAI_KEY=<your token>" >> ~/.aicommits

This one might not support UTF-8 depending on your Windows configuration.

I did some testing to understand what the result was:
Input
code

Output
image

And I quickly realized that the parse would not work.

Here are the only 3 solutions I have found to fix this problem:

  1. Using replace(), but this solution doesn't seem ideal to me.
const configString = (await fs.readFile(configPath, 'utf8')).replace(/[^\u0020-\u007E]/g, '');
  1. Using environment variables Support for Windows #43
  2. Creating the file manually with vscode or notepad in UTF-8
@Nutlope
Copy link
Owner

Nutlope commented Feb 16, 2023

Thanks for this issue! Maybe we should add the environment variable workaround as a footnote in the README for folks who run into issues on Windows.

@privatenumber
Copy link
Collaborator

I'll follow up with a quick config command. Better to set a secure example.

@privatenumber
Copy link
Collaborator

Closed via #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants