Search code examples
jspm

jspm registry create without prompt


To add a custom git source as a JSPM registry, it seems the only option is to run the following at the command line :

jspm registry create mySource jspm-git

At which point you get prompted to enter the source url, ssh://[email protected]. How can I do this in a single command, without the prompt? This would be pretty useful for automated, unattended builds. Better still, can registries be defined directly in a project's package.json file, as part of the local jspm config?


Solution

  • Found the answer at https://github.com/jspm/jspm-cli/issues/431

    All you need to do is add the " -y" switch at the end of your statement, for example,

    jspm registry create bower jspm-bower-endpoint -y
    

    will add bower without prompting you. Confirmed working on Linux and Windows 10, I'm not sure if it's a bash convention, so it might not work on older version of Windows.

    UPDATE :

    The answer above is wrong, I muddled the git and bower endpoint handlers. To properly register bitbucket from script, use

    jspm config registries.bitbucket.remote https://bitbucket.org
    jspm config registries.bitbucket.baseurl https://bitbucket.org
    jspm config registries.bitbucket.handler jspm-git