squishjs 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Asset.js +4 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squishjs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "squish & unsquish stuff",
5
5
  "scripts": {
6
6
  "test": "node testRunner.js"
package/src/Asset.js CHANGED
@@ -1,3 +1,7 @@
1
+ const path = require('path');
2
+
3
+ const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
4
+
1
5
  class Asset {
2
6
  constructor(info, data = null) {
3
7
  this.info = info;
@@ -66,9 +70,6 @@ class Asset {
66
70
  };
67
71
 
68
72
  getFileLocation() {
69
-
70
- const HG_ASSET_PATH = this.getConfigValue('HG_ASSET_PATH', `${process.cwd()}/.asset_cache`);
71
-
72
73
  const fileHash = this.getHash(this.info.id);
73
74
  return `${HG_ASSET_PATH}/${fileHash}`;
74
75
  }
@@ -91,9 +92,6 @@ class Asset {
91
92
  }
92
93
 
93
94
  async downloadSync(force) {
94
-
95
- const HG_ASSET_PATH = this.getConfigValue('HG_ASSET_PATH', `${process.cwd()}/.asset_cache`);
96
-
97
95
  if (!fs.existsSync(HG_ASSET_PATH)) {
98
96
  fs.mkdirSync(HG_ASSET_PATH);
99
97
  }
@@ -111,9 +109,6 @@ class Asset {
111
109
  }
112
110
 
113
111
  download(force) {
114
-
115
- const HG_ASSET_PATH = this.getConfigValue('HG_ASSET_PATH', `${process.cwd()}/.asset_cache`);
116
-
117
112
  if (!this.fs.existsSync(HG_ASSET_PATH)) {
118
113
  this.fs.mkdirSync(HG_ASSET_PATH);
119
114
  }