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

Invocation after installation fails #83

Closed
samirshaik opened this issue Nov 21, 2019 · 4 comments
Closed

Invocation after installation fails #83

samirshaik opened this issue Nov 21, 2019 · 4 comments
Assignees

Comments

@samirshaik
Copy link

samirshaik commented Nov 21, 2019

Installed using command: npm install git-lab-cli -g

How was it fixed (note that the command without --global as mentioned on your site doesn't work):
git config --global --add gitlab.url ""
git config --global --add gitlab.token ""

Opened up new terminal and tried command: lab --help

Expected Behavior:

C:\Users\sshaik>lab --help
Usage: index [options] [command]

gitlab command line utility

Options:
  -V, --version                 output the version number
  -h, --help                    output usage information

Commands:
  browse [options]              Open current branch page in gitlab
  compare [options]             Open compare page between two branches
  merge-request|mr [options]    Create merge request on gitlab
  merge-requests|mrs [options]  Opens merge requests page for the repo

Actual Behavior:

C:\Users\sshaik>lab --help
'true' is not recognized as an internal or external command,
operable program or batch file.
child_process.js:656
    throw err;
    ^

Error: Command failed: git config --get gitlab.url || true
'true' is not recognized as an internal or external command,
operable program or batch file.

    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:653:13)
    at Object.get (C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\options.js:11:16)
    at C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\options.js:21:23
    at Object.<anonymous> (C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\options.js:55:5)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\sshaik\AppData\Roaming\npm\node_modules\git-lab-cli\index.js:15:15)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
@vishwanatharondekar
Copy link
Owner

As I understand correctly, you are saying --help command doesnt work without setting the git config global.

Any lab command should have asked for input for those variables. Ideally help doesnt need those variables. I will check and make an update if necessary.

@samirshaik
Copy link
Author

samirshaik commented Nov 21, 2019 via email

@vishwanatharondekar vishwanatharondekar self-assigned this Nov 23, 2019
@daniel-vera-g
Copy link
Contributor

Thank you for quick response. 1. As per the configuration mentioned in your ReadMe.md, you are missing "--global" in Git config command. I had to add it to make it work. 2. help command doesn't ask me to setup missing configuration as mentioned in the ReadMe.md file. Thanks,

Hey, I just installed it and cannot reproduce your issue.

  1. The config does not store the git config as --global because the aim of this approach is to keep the credentials only for the current repository. The credentials get stored under your projects .git/config. If you want global config, either add the credentials to your global .gitignore manually or as ENV variables as stated in the README.

  2. Can't reproduce it. I installed the application, went to an gitlab repository and run: lab -h everything worked as expected.

@vishwanatharondekar
Copy link
Owner

Closing since cannot reproduce.

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