2020-01-21 23:22:17 +03:00
|
|
|
/**
|
|
|
|
* Copyright 2017 Google Inc. All rights reserved.
|
|
|
|
* Modifications copyright (c) Microsoft Corporation.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2020-03-26 08:32:54 +03:00
|
|
|
// This file is only run when someone installs via the github repo
|
2020-01-21 23:22:17 +03:00
|
|
|
|
2020-03-20 11:30:35 +03:00
|
|
|
const {execSync} = require('child_process');
|
2021-06-07 03:09:53 +03:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
console.log(`Updating test runner...`);
|
|
|
|
try {
|
|
|
|
execSync('npm ci --save=false --fund=false --audit=false', {
|
|
|
|
stdio: ['inherit', 'inherit', 'inherit'],
|
|
|
|
cwd: path.join(__dirname, 'tests', 'config', 'test-runner'),
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
process.exit(1);
|
|
|
|
}
|
2020-01-21 23:22:17 +03:00
|
|
|
|
2020-07-02 01:22:29 +03:00
|
|
|
console.log(`Rebuilding installer...`);
|
|
|
|
try {
|
2021-06-24 04:01:48 +03:00
|
|
|
execSync('npm run build-installer', {
|
2021-03-23 03:39:03 +03:00
|
|
|
stdio: ['inherit', 'inherit', 'inherit'],
|
|
|
|
});
|
2020-07-02 01:22:29 +03:00
|
|
|
} catch (e) {
|
2021-03-23 03:39:03 +03:00
|
|
|
process.exit(1);
|
2020-03-26 08:32:54 +03:00
|
|
|
}
|
|
|
|
|
2020-07-02 01:22:29 +03:00
|
|
|
console.log(`Downloading browsers...`);
|
2021-07-07 06:59:16 +03:00
|
|
|
const { installDefaultBrowsersForNpmInstall } = require('./lib/utils/registry');
|
|
|
|
installDefaultBrowsersForNpmInstall().catch(e => {
|
2020-12-21 23:31:01 +03:00
|
|
|
console.error(`Failed to install browsers, caused by\n${e.stack}`);
|
|
|
|
process.exit(1);
|
|
|
|
});
|
2020-01-21 23:22:17 +03:00
|
|
|
|
2020-07-02 01:22:29 +03:00
|
|
|
console.log(`Done. Use "npm run watch" to compile.`);
|