mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 00:50:28 +00:00
GitHub saver: Fix problem with saving to a non-existent directory
This commit is contained in:
parent
232eba2f7d
commit
b32a5aa9af
@ -56,16 +56,18 @@ GitHubSaver.prototype.save = function(text,method,callback) {
|
||||
ref: branch
|
||||
},
|
||||
callback: function(err,getResponseDataJson,xhr) {
|
||||
if(err) {
|
||||
var getResponseData,sha = "";
|
||||
if(err && xhr.status !== 404) {
|
||||
return callback(err);
|
||||
}
|
||||
var getResponseData = JSON.parse(getResponseDataJson),
|
||||
sha = "";
|
||||
$tw.utils.each(getResponseData,function(details) {
|
||||
if(details.name === filename) {
|
||||
sha = details.sha;
|
||||
}
|
||||
});
|
||||
if(xhr.status !== 404) {
|
||||
getResponseData = JSON.parse(getResponseDataJson);
|
||||
$tw.utils.each(getResponseData,function(details) {
|
||||
if(details.name === filename) {
|
||||
sha = details.sha;
|
||||
}
|
||||
});
|
||||
}
|
||||
var data = {
|
||||
message: "Saved by TiddlyWiki",
|
||||
content: base64utf8.base64.encode.call(base64utf8,text),
|
||||
|
Loading…
Reference in New Issue
Block a user