backend-manager 3.2.64 → 3.2.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -27,6 +27,10 @@ Module.prototype.main = function () {
|
|
|
27
27
|
|
|
28
28
|
assistant.log(`main(): Creating post...`, repoInfo);
|
|
29
29
|
|
|
30
|
+
// Set defaults
|
|
31
|
+
const githubUser = get(self.Manager.config, 'github.user');
|
|
32
|
+
const githubKey = get(self.Manager.config, 'github.key');
|
|
33
|
+
|
|
30
34
|
// Save to disk OR commit
|
|
31
35
|
poster.onDownload = function (meta) {
|
|
32
36
|
return new Promise(async function(resolve, reject) {
|
|
@@ -40,7 +44,7 @@ Module.prototype.main = function () {
|
|
|
40
44
|
// Save to disk
|
|
41
45
|
poster.readImage(tempPath)
|
|
42
46
|
.then(image => {
|
|
43
|
-
createFile(
|
|
47
|
+
self.createFile(githubUser, repoInfo.user, repoInfo.name, githubKey, finalPath, image)
|
|
44
48
|
.then(() => {resolve()})
|
|
45
49
|
.catch((e) => {reject(e)})
|
|
46
50
|
})
|
|
@@ -70,13 +74,12 @@ Module.prototype.main = function () {
|
|
|
70
74
|
// assistant.error(`Failed to ping google: ${e}`);
|
|
71
75
|
// }
|
|
72
76
|
|
|
73
|
-
//
|
|
74
|
-
const githubUser = get(self.Manager.config, 'github.user');
|
|
75
|
-
const githubKey = get(self.Manager.config, 'github.key');
|
|
77
|
+
// Set file path and content
|
|
76
78
|
const filePath = poster.removeDirDot(finalPost.path);
|
|
77
79
|
const fileContent = finalPost.content;
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
// Save post OR commit
|
|
82
|
+
await self.createFile(githubUser, repoInfo.user, repoInfo.name, githubKey, filePath, fileContent)
|
|
80
83
|
.then(() => {
|
|
81
84
|
return resolve({data: finalPost});
|
|
82
85
|
})
|