sfc-utils 1.3.28 → 1.3.29
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/copy/c2p_sheet.js +7 -7
- package/copy/sheets.js +7 -7
- package/package.json +1 -1
package/copy/c2p_sheet.js
CHANGED
|
@@ -17,24 +17,24 @@ var path = require("path");
|
|
|
17
17
|
// let configData = JSON.parse(config)
|
|
18
18
|
|
|
19
19
|
let googleAuth = (configData) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
var auth = null;
|
|
21
|
+
authObj
|
|
22
|
+
.authenticate({ fallback: false })
|
|
23
|
+
.then((resp) => {
|
|
23
24
|
auth = resp;
|
|
24
|
-
createSheet(auth, false, configData).
|
|
25
|
+
createSheet(auth, false, configData).catch(() => {
|
|
25
26
|
// If the first attempt failed, then make another req using the fallback
|
|
26
27
|
authObj.authenticate({ fallback: true }).then((resp) => {
|
|
27
28
|
auth = resp;
|
|
28
|
-
createSheet(auth, true, configData)
|
|
29
|
+
createSheet(auth, true, configData);
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
32
|
})
|
|
32
33
|
.catch(() => {
|
|
33
34
|
// Failure if we fall back but there's no token
|
|
34
35
|
auth = authObj.task();
|
|
35
|
-
createSheet(auth, true, configData)
|
|
36
|
+
createSheet(auth, true, configData);
|
|
36
37
|
});
|
|
37
|
-
})
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
let createSheet = (auth, fallback, configData) => {
|
package/copy/sheets.js
CHANGED
|
@@ -37,24 +37,24 @@ var cast = function (str, forceStr) {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
let googleAuth = (project, directory = null, forceStr = false) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.authenticate({ fallback: false })
|
|
43
|
-
.then((resp) => {
|
|
40
|
+
return new Promise(resolve => {
|
|
41
|
+
var auth = null;
|
|
42
|
+
authObj.authenticate({ fallback: false }).then((resp) => {
|
|
44
43
|
auth = resp;
|
|
45
|
-
grabSheets(auth, project, directory, forceStr).catch(() => {
|
|
44
|
+
grabSheets(auth, project, directory, forceStr).then(() => resolve()).catch(() => {
|
|
46
45
|
// If the first attempt failed, then make another req using the fallback
|
|
47
46
|
authObj.authenticate({ fallback: true }).then((resp) => {
|
|
48
47
|
auth = resp;
|
|
49
|
-
grabSheets(auth, project, directory, forceStr);
|
|
48
|
+
grabSheets(auth, project, directory, forceStr).then(() => resolve());
|
|
50
49
|
});
|
|
51
50
|
});
|
|
52
51
|
})
|
|
53
52
|
.catch(() => {
|
|
54
53
|
// Failure if we fall back but there's no token
|
|
55
54
|
auth = authObj.task();
|
|
56
|
-
grabSheets(auth, project, directory, forceStr);
|
|
55
|
+
grabSheets(auth, project, directory, forceStr).then(() => resolve());
|
|
57
56
|
});
|
|
57
|
+
}
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
let grabSheets = (auth, project, directory, forceStr) => {
|