Skip to content

Commit 46af25b

Browse files
author
Nathan Turinski
committed
PR feedback
1 parent d798c67 commit 46af25b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/templates/dotnet/executeDotnetTemplateCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { type IActionContext } from '@microsoft/vscode-azext-utils';
6+
import { randomUtils, type IActionContext } from '@microsoft/vscode-azext-utils';
77
import { composeArgs, withArg, withNamedArg, withQuotedArg } from '@microsoft/vscode-processutils';
88
import * as fs from 'fs';
99
import * as os from 'os';
@@ -80,7 +80,7 @@ export async function executeDotnetTemplateCreate(
8080

8181
// Use an isolated DOTNET_CLI_HOME so template installation doesn't affect the user's global state
8282
// This is how the JSON CLI tool operateed
83-
const tempCliHome = path.join(os.tmpdir(), `azfunc-dotnet-home-${Date.now()}-${Math.random().toString(36).substring(2)}`);
83+
const tempCliHome = path.join(os.tmpdir(), `azfunc-dotnet-home-${randomUtils.getRandomHexString()}`);
8484
const prevDotnetCliHome = process.env.DOTNET_CLI_HOME;
8585

8686
try {

src/templates/dotnet/parseNupkgTemplates.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import { randomUtils } from '@microsoft/vscode-azext-utils';
67
import extract from 'extract-zip';
78
import * as fs from 'fs';
89
import * as os from 'os';
@@ -62,7 +63,7 @@ export interface RawTemplate {
6263
* This replaces the need for the Microsoft.TemplateEngine.JsonCli tool.
6364
*/
6465
export async function parseTemplatesFromNupkg(nupkgPath: string): Promise<RawTemplate[]> {
65-
const tempDir = path.join(os.tmpdir(), `azfunc-templates-${Date.now()}-${Math.random().toString(36).substring(2)}`);
66+
const tempDir = path.join(os.tmpdir(), `azfunc-templates-${randomUtils.getRandomHexString()}`);
6667

6768
try {
6869
await extract(nupkgPath, { dir: tempDir });

0 commit comments

Comments
 (0)