【发布时间】:2018-11-25 20:27:33
【问题描述】:
我正在尝试使用此脚本进行首次提交并将包公开发布到 Github。
{
"scripts": {
"first": "git add -A && git commit -m \"First commit\" && A='{\"name\":\"'$npm_package_name'\",\"description\":\"'$npm_package_description'\",\"license_template\":\"'$npm_package_license'\"}' && echo \"${A}\" && curl -u $npm_package_author_name 'https://api.github.com/'$npm_package_author_name'/'$npm_package_name -d \"$A\" && git remote add origin 'https://github.com/'$npm_package_author_name'/'$npm_package_name'.git' && git push -u origin master"
}
}
我不断收到此错误。我已经搜索了文档,但不知道为什么。这不可能吗?请帮忙!
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3"
}
编辑: 这是工作脚本!我必须进行一些更改才能与添加许可证文件的 Github 的原始/主原始提交合并。 github api create repository doc for reference
"first": "O='{\"name\":\"'$npm_package_name'\",\"description\":\"'$npm_package_description'\",\"license_template\":\"'$npm_package_license'\"}' && echo \"${O}\" && curl -u $npm_package_author_name https://api.github.com/user/repos -d \"${A}\" && git add -A && git commit -m \"initial\" && git remote add origin 'https://github.com/'$npm_package_author_name'/'$npm_package_name'.git' && git merge origin/master --allow-unrelated-histories -m $npm_package_version && git push --set-upstream origin master && git push && git push --tags"
【问题讨论】:
标签: bash npm github-api npm-scripts