Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/environment/node/wait.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { writeFileSync } from 'fs';
7
import { tmpdir } from 'os';
8
import { randomPath } from '../../../base/common/extpath.js';
9
10
export function createWaitMarkerFileSync(verbose?: boolean): string | undefined {
11
const randomWaitMarkerPath = randomPath(tmpdir());
12
13
try {
14
writeFileSync(randomWaitMarkerPath, ''); // use built-in fs to avoid dragging in more dependencies
15
if (verbose) {
16
console.log(`Marker file for --wait created: ${randomWaitMarkerPath}`);
17
}
18
return randomWaitMarkerPath;
19
} catch (err) {
20
if (verbose) {
21
console.error(`Failed to create marker file for --wait: ${err}`);
22
}
23
return undefined;
24
}
25
}
26
27