squishjs 1.0.3 → 1.0.4
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 +1 -1
- package/src/Asset.js +3 -2
package/package.json
CHANGED
package/src/Asset.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const { getAppDataPath } = require('./utils');
|
|
3
3
|
|
|
4
|
-
const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
|
|
5
|
-
|
|
6
4
|
class Asset {
|
|
7
5
|
constructor(info, data = null) {
|
|
8
6
|
this.info = info;
|
|
@@ -72,6 +70,7 @@ class Asset {
|
|
|
72
70
|
|
|
73
71
|
getFileLocation() {
|
|
74
72
|
const fileHash = this.getHash(this.info.id);
|
|
73
|
+
const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
|
|
75
74
|
return `${HG_ASSET_PATH}/${fileHash}`;
|
|
76
75
|
}
|
|
77
76
|
|
|
@@ -93,6 +92,7 @@ class Asset {
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
async downloadSync(force) {
|
|
95
|
+
const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
|
|
96
96
|
if (!fs.existsSync(HG_ASSET_PATH)) {
|
|
97
97
|
fs.mkdirSync(HG_ASSET_PATH);
|
|
98
98
|
}
|
|
@@ -110,6 +110,7 @@ class Asset {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
download(force) {
|
|
113
|
+
const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
|
|
113
114
|
if (!this.fs.existsSync(HG_ASSET_PATH)) {
|
|
114
115
|
this.fs.mkdirSync(HG_ASSET_PATH);
|
|
115
116
|
}
|