mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Use simpler dirname
This commit is contained in:
@@ -21,7 +21,7 @@ import { fileURLToPath } from 'url';
|
||||
|
||||
const { debounce } = utilModule;
|
||||
const { createReporter } = reporterModule;
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
|
||||
const root = 'cli';
|
||||
const rootAbs = path.resolve(__dirname, '..', root);
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
import gulp from 'gulp';
|
||||
import util from './lib/util.js';
|
||||
import date from './lib/date.js';
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
import gulp from 'gulp';
|
||||
import * as path from 'path';
|
||||
import util from './lib/util.js';
|
||||
@@ -20,10 +18,9 @@ import monacoapi from './lib/monaco-api.js';
|
||||
import * as fs from 'fs';
|
||||
import filter from 'gulp-filter';
|
||||
import reporterModule from './lib/reporter.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
import monacoPackage from './monaco/package.json' with { type: 'json' };
|
||||
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
const { getVersion } = getVersionModule;
|
||||
const { createReporter } = reporterModule;
|
||||
const root = path.dirname(__dirname);
|
||||
|
||||
@@ -23,7 +23,7 @@ import { fileURLToPath } from 'url';
|
||||
|
||||
EventEmitter.defaultMaxListeners = 100;
|
||||
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
const { getVersion } = getVersionModule;
|
||||
const { createReporter } = reporterModule;
|
||||
const root = path.dirname(__dirname);
|
||||
|
||||
@@ -17,7 +17,7 @@ import util from './lib/util.js';
|
||||
EventEmitter.defaultMaxListeners = 100;
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
|
||||
const { transpileTask, compileTask, watchTask, compileApiProposalNamesTask, watchApiProposalNamesTask } = compilation;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ const { getVersion } = getVersionModule;
|
||||
const { getProductionDependencies } = dependenciesModule;
|
||||
const { readISODate } = dateModule;
|
||||
const { fetchUrls, fetchGithub } = fetchModule;
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
|
||||
const REPO_ROOT = path.dirname(__dirname);
|
||||
const commit = getVersion(REPO_ROOT);
|
||||
|
||||
@@ -16,7 +16,7 @@ import { fileURLToPath } from 'url';
|
||||
|
||||
const { config } = electronConfigModule;
|
||||
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
const root = path.dirname(__dirname);
|
||||
|
||||
const BUILD_TARGETS = [
|
||||
|
||||
@@ -23,7 +23,7 @@ import { fileURLToPath } from 'url';
|
||||
const { rimraf } = utilModule;
|
||||
const { getVersion } = getVersionModule;
|
||||
const { recommendedDeps: debianRecommendedDependencies } = depLists;
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
const exec = promisify(cp.exec);
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = getVersion(root);
|
||||
|
||||
@@ -43,7 +43,7 @@ const { config } = electronModule;
|
||||
const { createAsar } = asarModule;
|
||||
const glob = promisify(globCallback);
|
||||
const rcedit = promisify(rceditCallback);
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = getVersion(root);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import { fileURLToPath } from 'url';
|
||||
const { getVersion } = getVersionModule;
|
||||
const { readISODate } = dateModule;
|
||||
const { getProductionDependencies } = dependenciesModule;
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname
|
||||
|
||||
const REPO_ROOT = path.dirname(__dirname);
|
||||
const BUILD_ROOT = path.dirname(REPO_ROOT);
|
||||
|
||||
@@ -16,7 +16,7 @@ import rcedit from 'rcedit';
|
||||
import { createRequire } from 'module';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
const __dirname = import.meta.dirname;
|
||||
const repoPath = path.dirname(__dirname);
|
||||
const buildPath = (/** @type {string} */ arch) => path.join(path.dirname(repoPath), `VSCode-win32-${arch}`);
|
||||
const setupDir = (/** @type {string} */ arch, /** @type {string} */ target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
||||
|
||||
Reference in New Issue
Block a user