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

profile.json file not found error #2

Closed
dawsbot opened this issue Mar 24, 2016 · 3 comments
Closed

profile.json file not found error #2

dawsbot opened this issue Mar 24, 2016 · 3 comments

Comments

@dawsbot
Copy link

dawsbot commented Mar 24, 2016

image

sist output:

OS

Darwin
x64

node

npm -v: 3.6.0
node --version: v5.7.1

shell

uname: Darwin
echo $SHELL: /bin/zsh
echo $TERM: xterm-256color
echo $TERM_PROGRAM: iTerm.app

Time created: Thu Mar 24 2016 16:41:28 GMT-0600 (MDT)

@dawsbot dawsbot changed the title profile.json not found profile.json file not found error Mar 24, 2016
@abrelsfo
Copy link
Owner

@dawsonbotsford I want to store that file with all the other files in the package but I can't figure out how to access it. Do you know how? Can you tell me if creepin is located at /usr/lib/nodejs/lib/node_modules/creepin

@dawsbot
Copy link
Author

dawsbot commented Mar 28, 2016

Where my creepin is stored is irrelevant. You should be able to take care of this with relative paths -similar to how I did it in opent.

Look at like 57 and onward here

try {
  fs.statSync(path.join(__dirname, '/config.json'));
  const username = JSON.parse(fs.readFileSync('config.json', 'utf-8')).username;
  openPackages(username);
} catch (err) {
  inquirer.prompt([
    {
      type: 'input',
      name: 'username',
      message: 'What\'s your GitHub username?'
    }], function (answers) {
    fs.writeFileSync(path.join(__dirname, '/config.json'), `{"username": "${answers.username}"}`);
    openPackages(answers.username);
  });
}

It's all about the __dirname

@dawsbot dawsbot closed this as completed Mar 28, 2016
@dawsbot dawsbot reopened this Mar 28, 2016
@abrelsfo
Copy link
Owner

@dawsonbotsford Finally! that's all I've been looking for is __dirname and it wasn't mentioned in any of the posts pertaining to where the module is located

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

2 participants