Fix static assets path

This commit is contained in:
Christopher Willis-Ford 2018-10-22 17:21:13 -07:00
parent 914f883c65
commit 071ba28fc8
4 changed files with 5 additions and 7 deletions

2
.gitignore vendored
View file

@ -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

View file

@ -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);

View file

@ -3,5 +3,6 @@ module.exports = {
env: {
node: true
},
extends: ['scratch', 'scratch/es6']
extends: ['scratch', 'scratch/es6'],
globals: ['__static']
};

View file

@ -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'
}
])
],