Path: blob/main/src/vs/platform/environment/node/wait.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { writeFileSync } from 'fs';6import { tmpdir } from 'os';7import { randomPath } from '../../../base/common/extpath.js';89export function createWaitMarkerFileSync(verbose?: boolean): string | undefined {10const randomWaitMarkerPath = randomPath(tmpdir());1112try {13writeFileSync(randomWaitMarkerPath, ''); // use built-in fs to avoid dragging in more dependencies14if (verbose) {15console.log(`Marker file for --wait created: ${randomWaitMarkerPath}`);16}17return randomWaitMarkerPath;18} catch (err) {19if (verbose) {20console.error(`Failed to create marker file for --wait: ${err}`);21}22return undefined;23}24}252627