Browse Source
It's awful but means that we create the directory on all platforms in-process. Fixes https://github.com/vector-im/riot-web/issues/13215pull/13227/head
4 changed files with 32 additions and 27 deletions
@ -0,0 +1,22 @@
|
||||
// This is a JS script so that the directory is created in-process on Windows.
|
||||
// Sorry.
|
||||
|
||||
const fs = require("fs"); |
||||
const path = require("path"); |
||||
const mkdirp = require("mkdirp"); |
||||
const fetch = require("node-fetch"); |
||||
|
||||
console.log("Making webapp directory"); |
||||
mkdirp.sync("webapp"); |
||||
|
||||
// curl -s https://jitsi.riot.im/libs/external_api.min.js > ./webapp/jitsi_external_api.min.js
|
||||
console.log("Downloading Jitsi script"); |
||||
const fname = path.join("webapp", "jitsi_external_api.min.js"); |
||||
fetch("https://jitsi.riot.im/libs/external_api.min.js").then(res => { |
||||
const stream = fs.createWriteStream(fname); |
||||
return new Promise((resolve, reject) => { |
||||
res.body.pipe(stream); |
||||
res.body.on('error', err => reject(err)); |
||||
res.body.on('finish', () => resolve()); |
||||
}); |
||||
}).then(() => console.log('Done with Jitsi download')); |
@ -1,7 +0,0 @@
|
||||
#!/bin/bash |
||||
|
||||
if [[ ! -f "./webapp" ]]; then |
||||
mkdir "./webapp" |
||||
fi |
||||
|
||||
curl -s https://jitsi.riot.im/libs/external_api.min.js > ./webapp/jitsi_external_api.min.js |
Loading…
Reference in new issue