Skip to content

Commit 1cd48d6

Browse files
committed
Merge branch 'main' into ddelemeny-logcontext
2 parents 9942641 + 1054354 commit 1cd48d6

File tree

8 files changed

+3771
-5579
lines changed

8 files changed

+3771
-5579
lines changed

.config/webpack/utils.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
import fs from 'fs';
2+
import process from 'process';
3+
import os from 'os';
24
import path from 'path';
3-
import util from 'util';
45
import { glob } from 'glob';
56
import { SOURCE_DIR } from './constants';
67

8+
export function isWSL() {
9+
if (process.platform !== 'linux') {
10+
return false;
11+
}
12+
13+
if (os.release().toLowerCase().includes('microsoft')) {
14+
return true;
15+
}
16+
17+
try {
18+
return fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft');
19+
} catch {
20+
return false;
21+
}
22+
}
23+
724
export function getPackageJson() {
825
return require(path.resolve(process.cwd(), 'package.json'));
926
}
@@ -21,7 +38,8 @@ export function hasReadme() {
2138
export async function getEntries(): Promise<Record<string, string>> {
2239
const pluginsJson = await glob('**/src/**/plugin.json', { absolute: true });
2340

24-
const plugins = await Promise.all(pluginsJson.map((pluginJson) => {
41+
const plugins = await Promise.all(
42+
pluginsJson.map((pluginJson) => {
2543
const folder = path.dirname(pluginJson);
2644
return glob(`${folder}/module.{ts,tsx,js,jsx}`, { absolute: true });
2745
})

0 commit comments

Comments
 (0)