chore: reformat and get rid of deprecates in repack-juggler script (#10582)
This commit is contained in:
parent
63abf0950b
commit
1a6d59311d
|
|
@ -1,4 +1,19 @@
|
|||
#!/usr/bin/env node
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import * as path from 'path';
|
||||
import * as URL from 'url';
|
||||
|
|
@ -84,7 +99,7 @@ async function ensureFirefoxBuild(browserName, buildNumber, buildPlatform) {
|
|||
|
||||
if (currentBuildInfo.buildPlatform === buildPlatform && currentBuildInfo.buildNumber === buildNumber && currentBuildInfo.browserName === browserName)
|
||||
return currentBuildInfo;
|
||||
await fs.promises.rmdir(BUILD_DIRECTORY, { recursive: true }).catch(e => {});
|
||||
await fs.promises.rm(BUILD_DIRECTORY, { recursive: true }).catch(e => {});
|
||||
await fs.promises.mkdir(BUILD_DIRECTORY);
|
||||
const buildZipPath = path.join(BUILD_DIRECTORY, 'firefox.zip');
|
||||
|
||||
|
|
@ -127,12 +142,12 @@ async function repackageJuggler(browserName, buildInfo) {
|
|||
}
|
||||
|
||||
// Let's repackage omni folder!
|
||||
await fs.promises.rmdir(OMNI_EXTRACT_DIR, { recursive: true }).catch(e => {});
|
||||
await fs.promises.rm(OMNI_EXTRACT_DIR, { recursive: true }).catch(e => {});
|
||||
await fs.promises.mkdir(OMNI_EXTRACT_DIR);
|
||||
|
||||
await spawnAsync('unzip', [OMNI_BACKUP_PATH], { cwd: OMNI_EXTRACT_DIR });
|
||||
// Remove current juggler directory
|
||||
await fs.promises.rmdir(OMNI_JUGGLER_DIR, { recursive: true });
|
||||
await fs.promises.rm(OMNI_JUGGLER_DIR, { recursive: true });
|
||||
// Repopulate with tip-of-tree juggler files
|
||||
const jarmn = await fs.promises.readFile(JARMN_PATH, 'utf8');
|
||||
const jarLines = jarmn.split('\n').map(line => line.trim()).filter(line => line.startsWith('content/') && line.endsWith(')'));
|
||||
|
|
@ -161,7 +176,7 @@ async function repackageJuggler(browserName, buildInfo) {
|
|||
|
||||
|
||||
function httpRequest(url, method, response) {
|
||||
let options = URL.parse(url);
|
||||
const options = URL.parse(url);
|
||||
options.method = method;
|
||||
|
||||
const requestCallback = res => {
|
||||
|
|
@ -237,8 +252,7 @@ function getUbuntuVersionSync() {
|
|||
if (!osReleaseText)
|
||||
return '';
|
||||
return getUbuntuVersionInternal(osReleaseText);
|
||||
}
|
||||
catch (e) {
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue