mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Lint scripts dir
This commit is contained in:
parent
046170e3ec
commit
5fc72e8f73
@ -5,6 +5,7 @@ module.exports = {
|
|||||||
ecmaVersion: 8,
|
ecmaVersion: 8,
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
|
es6: true,
|
||||||
node: true,
|
node: true,
|
||||||
// we also have some browser code (ie. the preload script)
|
// we also have some browser code (ie. the preload script)
|
||||||
browser: true,
|
browser: true,
|
||||||
|
@ -5,7 +5,7 @@ const path = require('path');
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const fsPromises = require('fs').promises;
|
const fsPromises = require('fs').promises;
|
||||||
const { https } = require('follow-redirects');
|
const { https } = require('follow-redirects');
|
||||||
const child_process = require('child_process');
|
const childProcess = require('child_process');
|
||||||
const tar = require('tar');
|
const tar = require('tar');
|
||||||
const asar = require('asar');
|
const asar = require('asar');
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ async function downloadToFile(url, filename) {
|
|||||||
|
|
||||||
async function verifyFile(filename) {
|
async function verifyFile(filename) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const gpgProc = child_process.execFile('gpg', ['--verify', filename + '.asc', filename], (error) => {
|
childProcess.execFile('gpg', ['--verify', filename + '.asc', filename], (error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error);
|
reject(error);
|
||||||
} else {
|
} else {
|
||||||
@ -93,7 +93,7 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const haveGpg = await new Promise((resolve) => {
|
const haveGpg = await new Promise((resolve) => {
|
||||||
child_process.execFile('gpg', ['--version'], (error) => {
|
childProcess.execFile('gpg', ['--version'], (error) => {
|
||||||
resolve(!error);
|
resolve(!error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -105,7 +105,7 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
const gpgProc = child_process.execFile('gpg', ['--import'], (error) => {
|
const gpgProc = childProcess.execFile('gpg', ['--import'], (error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log("Failed to import key", error);
|
console.log("Failed to import key", error);
|
||||||
} else {
|
} else {
|
||||||
@ -137,10 +137,10 @@ async function main() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const haveDeploy = false;
|
let haveDeploy = false;
|
||||||
const expectedDeployDir = path.join(deployDir, 'riot-' + targetVersion);
|
const expectedDeployDir = path.join(deployDir, 'riot-' + targetVersion);
|
||||||
try {
|
try {
|
||||||
const webappDir = await fs.opendir(expectedDeployDir);
|
await fs.opendir(expectedDeployDir);
|
||||||
console.log(expectedDeployDir + "already exists");
|
console.log(expectedDeployDir + "already exists");
|
||||||
haveDeploy = true;
|
haveDeploy = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -14,13 +14,8 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const path = require('path');
|
|
||||||
const url = require('url');
|
|
||||||
const fsProm = require('fs').promises;
|
|
||||||
const child_process = require('child_process');
|
|
||||||
|
|
||||||
async function build(hakEnv, moduleInfo) {
|
async function build(hakEnv, moduleInfo) {
|
||||||
moduleInfo.scripts.build(hakEnv, moduleInfo);
|
moduleInfo.scripts.build(hakEnv, moduleInfo);
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = build;
|
module.exports = build;
|
||||||
|
@ -62,6 +62,6 @@ async function copy(hakEnv, moduleInfo) {
|
|||||||
await fsProm.copyFile(src, dst);
|
await fsProm.copyFile(src, dst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = copy;
|
module.exports = copy;
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const url = require('url');
|
const url = require('url');
|
||||||
const fsProm = require('fs').promises;
|
const fsProm = require('fs').promises;
|
||||||
const child_process = require('child_process');
|
const childProcess = require('child_process');
|
||||||
|
|
||||||
const npm = require('npm');
|
const npm = require('npm');
|
||||||
const semver = require('semver');
|
const semver = require('semver');
|
||||||
@ -91,7 +91,7 @@ async function fetch(hakEnv, moduleInfo) {
|
|||||||
|
|
||||||
console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
|
console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const proc = child_process.spawn(
|
const proc = childProcess.spawn(
|
||||||
hakEnv.isWin() ? 'yarn.cmd' : 'yarn',
|
hakEnv.isWin() ? 'yarn.cmd' : 'yarn',
|
||||||
['install', '--ignore-scripts'],
|
['install', '--ignore-scripts'],
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,6 @@ async function fetchDeps(hakEnv, moduleInfo) {
|
|||||||
if (moduleInfo.scripts.fetchDeps) {
|
if (moduleInfo.scripts.fetchDeps) {
|
||||||
await moduleInfo.scripts.fetchDeps(hakEnv, moduleInfo);
|
await moduleInfo.scripts.fetchDeps(hakEnv, moduleInfo);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = fetchDeps;
|
module.exports = fetchDeps;
|
||||||
|
@ -15,7 +15,6 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fsProm = require('fs').promises;
|
|
||||||
|
|
||||||
const findNpmPrefix = require('find-npm-prefix');
|
const findNpmPrefix = require('find-npm-prefix');
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const fsProm = require('fs').promises;
|
const fsProm = require('fs').promises;
|
||||||
const child_process = require('child_process');
|
const childProcess = require('child_process');
|
||||||
|
|
||||||
async function link(hakEnv, moduleInfo) {
|
async function link(hakEnv, moduleInfo) {
|
||||||
const yarnrc = path.join(hakEnv.projectRoot, '.yarnrc');
|
const yarnrc = path.join(hakEnv.projectRoot, '.yarnrc');
|
||||||
@ -47,7 +47,7 @@ async function link(hakEnv, moduleInfo) {
|
|||||||
const yarnCmd = 'yarn' + (hakEnv.isWin() ? '.cmd' : '');
|
const yarnCmd = 'yarn' + (hakEnv.isWin() ? '.cmd' : '');
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const proc = child_process.spawn(yarnCmd, ['link'], {
|
const proc = childProcess.spawn(yarnCmd, ['link'], {
|
||||||
cwd: moduleInfo.moduleOutDir,
|
cwd: moduleInfo.moduleOutDir,
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
});
|
});
|
||||||
@ -57,7 +57,7 @@ async function link(hakEnv, moduleInfo) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const proc = child_process.spawn(yarnCmd, ['link', moduleInfo.name], {
|
const proc = childProcess.spawn(yarnCmd, ['link', moduleInfo.name], {
|
||||||
cwd: hakEnv.projectRoot,
|
cwd: hakEnv.projectRoot,
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
});
|
});
|
||||||
@ -65,6 +65,6 @@ async function link(hakEnv, moduleInfo) {
|
|||||||
code ? reject(code) : resolve();
|
code ? reject(code) : resolve();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = link;
|
module.exports = link;
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
|
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
const asar = require('asar');
|
const asar = require('asar');
|
||||||
const child_process = require('child_process');
|
const childProcess = require('child_process');
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
const webappDir = await fs.stat('webapp.asar');
|
await fs.stat('webapp.asar');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("No 'webapp.asar' found. Run 'yarn run fetch'");
|
console.log("No 'webapp.asar' found. Run 'yarn run fetch'");
|
||||||
return 1;
|
return 1;
|
||||||
@ -22,7 +22,7 @@ async function main() {
|
|||||||
// set version in package.json: electron-builder will use this to populate
|
// set version in package.json: electron-builder will use this to populate
|
||||||
// all the various version fields
|
// all the various version fields
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
child_process.execFile('yarn', [
|
childProcess.execFile('yarn', [
|
||||||
'version',
|
'version',
|
||||||
'-s',
|
'-s',
|
||||||
'--no-git-tag-version', // This also means "don't commit to git" as it turns out
|
'--no-git-tag-version', // This also means "don't commit to git" as it turns out
|
||||||
|
Loading…
Reference in New Issue
Block a user