Skip to content

Commit ecd39ef

Browse files
committed
remove fallback from package.ts and product.ts
1 parent 195e773 commit ecd39ef

3 files changed

Lines changed: 10 additions & 29 deletions

File tree

src/vs/platform/package.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ export interface IPackageConfiguration {
1111
version: string;
1212
}
1313

14-
let pkg: IPackageConfiguration;
15-
try {
16-
const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath);
17-
const packageJsonPath = path.join(rootPath, 'package.json');
18-
pkg = require.__$__nodeRequire(packageJsonPath) as IPackageConfiguration;
19-
} catch (error) {
20-
pkg = {
21-
name: 'code-oss-dev',
22-
version: '1.x.x'
23-
};
24-
}
25-
26-
export default pkg;
14+
const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath);
15+
const packageJsonPath = path.join(rootPath, 'package.json');
16+
export default require.__$__nodeRequire(packageJsonPath) as IPackageConfiguration;

src/vs/platform/product.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,9 @@ export interface IProductConfiguration {
4747
npsSurveyUrl: string;
4848
}
4949

50-
let product: IProductConfiguration;
51-
try {
52-
const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath);
53-
const productJsonPath = path.join(rootPath, 'product.json');
54-
product = require.__$__nodeRequire(productJsonPath) as IProductConfiguration;
55-
} catch (error) {
56-
product = <IProductConfiguration>{
57-
nameLong: 'Code - OSS',
58-
applicationName: 'code-oss',
59-
dataFolderName: '.vscode-oss'
60-
};
61-
}
50+
const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath);
51+
const productJsonPath = path.join(rootPath, 'product.json');
52+
const product = require.__$__nodeRequire(productJsonPath) as IProductConfiguration;
6253

6354
if (process.env['VSCODE_DEV']) {
6455
product.nameShort += ' Dev';

test/all.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ function main() {
7979
var loaderConfig = {
8080
nodeRequire: require,
8181
nodeMain: __filename,
82-
baseUrl: path.join(path.dirname(__dirname)),
82+
baseUrl: path.join(path.dirname(__dirname), 'src'),
8383
paths: {
84-
'vs': out + '/vs',
85-
'lib': out + '/lib',
86-
'bootstrap': out + '/bootstrap'
84+
'vs': `../${ out }/vs`,
85+
'lib': `../${ out }/lib`,
86+
'bootstrap': `../${ out }/bootstrap`
8787
},
8888
catchError: true
8989
};

0 commit comments

Comments
 (0)