github-picbed
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "github-picbed", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Upload file to github and Get Url", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -88,5 +88,6 @@ const request = require('./request'); | ||
filename = filename || fileHash + (extname || ''); | ||
let uploadname = filename.split('/').map(f => encodeURI(filename)).join('/') | ||
let rsp = await request({ | ||
path: `/repos/${_options.username}/${_options.repository}/contents${_options.path}${filename}?ref=${_options.branch}`, | ||
path: `/repos/${_options.username}/${_options.repository}/contents${_options.path}${uploadname}?ref=${_options.branch}`, | ||
token: _options.token, | ||
@@ -97,5 +98,4 @@ method: 'GET' | ||
if (!rsp.content) { | ||
console.dir(_options); | ||
let rsp = await request({ | ||
path: `/repos/${_options.username}/${_options.repository}/contents${_options.path}${filename}`, | ||
path: `/repos/${_options.username}/${_options.repository}/contents${_options.path}${uploadname}`, | ||
token: _options.token, | ||
@@ -102,0 +102,0 @@ method: 'PUT', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11219