putasset

2019-06-24 admin

putasset是什么

什么是putasset,upload asset to release on github

putasset使用教程帮助文档

Putasset License NPM version Dependency Status Build Status

Upload asset to release on github.

Install

npm i putasset -g

How to use?

Global

$ putasset
Usage: putasset [options]
Options:
  -h, --help      display this help and exit
  -v, --version   output version information and exit
  -r, --repo      name of repository
  -o, --owner     owner of repository
  -t, --tag       tag of repository (should exist!)
  -f, --filename  path to asset
  -k, --token     github token <https://github.com/settings/tokens/new>
  -l, --loud      output filename, repo, owner and tag before upload
  --show-url      show asset url
  --force         overwrite asset if one with same name already exist

$ putasset -k "token from url" \
-r putasset -o coderaiser -t v1.0.0 \
-f "release.zip" --show url

https://github.com/coderaiser/putasset/releases/download/v1.0.0/releases.zip

To set token environment variable PUTASSET_TOKEN could be used.

Local

npm i putasset --save

Data will be read before execution in next order (left is more important):

command line -> ~/.putasset.json

Example

const putasset = require('putasset'),
const token = 'token from https://github.com/settings/applications';

putasset(token, {
    owner: 'coderaiser',
    repo: 'putasset',
    tag: 'v1.0.0',
    filename: 'realease.zip',
}).then((url) => {
    console.log(`Upload success, download url: ${url}`);
}).catch((error) => {
    console.error(error.message);
});

Related

  • grizzly - Create release on github with help of node.

License

MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-68078.html

文章标题:putasset

回到顶部