mirror of
https://github.com/coder/code-server.git
synced 2024-12-24 10:12:15 +03:00
eae5d8c807
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
'use strict';
|
|
|
|
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
import * as crypto from 'crypto';
|
|
const { dirs } = require('../../npm/dirs');
|
|
|
|
const ROOT = path.join(__dirname, '../../../');
|
|
|
|
const shasum = crypto.createHash('sha1');
|
|
|
|
shasum.update(fs.readFileSync(path.join(ROOT, 'build/.cachesalt')));
|
|
shasum.update(fs.readFileSync(path.join(ROOT, '.yarnrc')));
|
|
shasum.update(fs.readFileSync(path.join(ROOT, 'remote/.yarnrc')));
|
|
|
|
// Add `yarn.lock` files
|
|
for (let dir of dirs) {
|
|
const yarnLockPath = path.join(ROOT, dir, 'yarn.lock');
|
|
shasum.update(fs.readFileSync(yarnLockPath));
|
|
}
|
|
|
|
// Add any other command line arguments
|
|
for (let i = 2; i < process.argv.length; i++) {
|
|
shasum.update(process.argv[i]);
|
|
}
|
|
|
|
process.stdout.write(shasum.digest('hex'));
|