You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
Tools: Use Yarn 3 to manage monorepo (#5833)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
const fs = require('fs-extra');
|
||||
const spawnSync = require('child_process').spawnSync;
|
||||
const { chdir } = require('process');
|
||||
|
||||
const babelPath = `${__dirname}/../node_modules/.bin/babel${process.platform === 'win32' ? '.cmd' : ''}`;
|
||||
const basePath = `${__dirname}/../../..`;
|
||||
|
||||
function fileIsNewerThan(path1, path2) {
|
||||
@ -14,6 +14,8 @@ function fileIsNewerThan(path1, path2) {
|
||||
}
|
||||
|
||||
function convertJsx(path) {
|
||||
chdir(`${__dirname}/..`);
|
||||
|
||||
fs.readdirSync(path).forEach((filename) => {
|
||||
const jsxPath = `${path}/${filename}`;
|
||||
const p = jsxPath.split('.');
|
||||
@ -28,7 +30,7 @@ function convertJsx(path) {
|
||||
|
||||
if (fileIsNewerThan(jsxPath, jsPath)) {
|
||||
console.info(`Compiling ${jsxPath}...`);
|
||||
const result = spawnSync(babelPath, ['--presets', 'react', '--out-file', jsPath, jsxPath]);
|
||||
const result = spawnSync('yarn', ['run', 'babel', '--presets', 'react', '--out-file', jsPath, jsxPath]);
|
||||
if (result.status !== 0) {
|
||||
const msg = [];
|
||||
if (result.stdout) msg.push(result.stdout.toString());
|
||||
|
Reference in New Issue
Block a user