mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2025-01-08 13:41:59 -05:00
Fix static assets path
This commit is contained in:
parent
914f883c65
commit
071ba28fc8
4 changed files with 5 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -5,7 +5,7 @@ node_modules/
|
|||
thumbs.db
|
||||
|
||||
# don't store the assets downloaded with the `fetch` script
|
||||
/src/static/assets/
|
||||
/static/assets/
|
||||
|
||||
# generated translation files
|
||||
/translations
|
||||
|
|
|
@ -9,6 +9,7 @@ const libraries = require('./lib/libraries');
|
|||
|
||||
const ASSET_HOST = 'cdn.assets.scratch.mit.edu';
|
||||
const NUM_SIMULTANEOUS_DOWNLOADS = 5;
|
||||
const OUT_PATH = path.resolve('static', 'assets');
|
||||
|
||||
|
||||
const describe = function (object) {
|
||||
|
@ -72,7 +73,7 @@ const fetchAsset = function (md5, callback) {
|
|||
return;
|
||||
}
|
||||
|
||||
const stream = fs.createWriteStream(path.resolve('src', 'static', 'assets', md5), {encoding: 'binary'});
|
||||
const stream = fs.createWriteStream(path.resolve(OUT_PATH, md5), {encoding: 'binary'});
|
||||
stream.on('error', callback);
|
||||
response.on('data', chunk => {
|
||||
stream.write(chunk);
|
||||
|
|
|
@ -3,5 +3,6 @@ module.exports = {
|
|||
env: {
|
||||
node: true
|
||||
},
|
||||
extends: ['scratch', 'scratch/es6']
|
||||
extends: ['scratch', 'scratch/es6'],
|
||||
globals: ['__static']
|
||||
};
|
||||
|
|
|
@ -62,10 +62,6 @@ module.exports = {
|
|||
{
|
||||
from: path.resolve(__dirname, 'node_modules', 'scratch-gui', 'dist', 'static'),
|
||||
to: 'static'
|
||||
},
|
||||
{
|
||||
from: path.resolve(__dirname, 'src', 'static'),
|
||||
to: 'static'
|
||||
}
|
||||
])
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue