backend-manager 3.2.64 → 3.2.65

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.2.64",
3
+ "version": "3.2.65",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -27,6 +27,12 @@ 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
+ const filePath = poster.removeDirDot(finalPost.path);
34
+ const fileContent = finalPost.content;
35
+
30
36
  // Save to disk OR commit
31
37
  poster.onDownload = function (meta) {
32
38
  return new Promise(async function(resolve, reject) {
@@ -40,7 +46,7 @@ Module.prototype.main = function () {
40
46
  // Save to disk
41
47
  poster.readImage(tempPath)
42
48
  .then(image => {
43
- createFile(get(self.Manager.config, 'github.user'), repoInfo.user, repoInfo.name, get(self.Manager.config, 'github.key'), finalPath, image)
49
+ self.createFile(githubUser, repoInfo.user, repoInfo.name, githubKey, finalPath, image)
44
50
  .then(() => {resolve()})
45
51
  .catch((e) => {reject(e)})
46
52
  })
@@ -71,12 +77,7 @@ Module.prototype.main = function () {
71
77
  // }
72
78
 
73
79
  // Save post OR commit
74
- const githubUser = get(self.Manager.config, 'github.user');
75
- const githubKey = get(self.Manager.config, 'github.key');
76
- const filePath = poster.removeDirDot(finalPost.path);
77
- const fileContent = finalPost.content;
78
-
79
- await createFile(githubUser, repoInfo.user, repoInfo.name, githubKey, filePath, fileContent)
80
+ await self.createFile(githubUser, repoInfo.user, repoInfo.name, githubKey, filePath, fileContent)
80
81
  .then(() => {
81
82
  return resolve({data: finalPost});
82
83
  })