X Tutup
The Wayback Machine - https://web.archive.org/web/20201201175156/https://github.com/vercel/pkg/issues/980
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

Create exe with txt file in it too #980

Open
MegaPowerlol opened this issue Oct 5, 2020 · 2 comments
Open

Create exe with txt file in it too #980

MegaPowerlol opened this issue Oct 5, 2020 · 2 comments

Comments

@MegaPowerlol
Copy link

@MegaPowerlol MegaPowerlol commented Oct 5, 2020

I'm creating a account generator and I want to make it exe pkg, but the problem is that my code takes the accounts from a accounts.txt file so when I make it exe it will not find the txt file, there is any solutions?

@aateek-albanero
Copy link

@aateek-albanero aateek-albanero commented Oct 9, 2020

I don't know if you have tried assets. I had a similar use case where I wanted to fetch a .env file.
Just try to refer it in related .js file using path.join(), see Detecting assets in source code

@sunaram
Copy link

@sunaram sunaram commented Oct 11, 2020

I'm creating a account generator and I want to make it exe pkg, but the problem is that my code takes the accounts from a accounts.txt file so when I make it exe it will not find the txt file, there is any solutions?

Let's assume your entry script app.js needs to load accounts.txt, rather than doing
const filePath = "accounts.txt";
do

const path = require("path");
const filePath = path.join(process.cwd(), "/accounts.txt");

Assuming accountx.txt is in the root folder

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.
X Tutup