From e682f888749257b148e69b83948318e3c9cea591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20APLAK?= Date: Fri, 9 Dec 2022 18:04:18 +0300 Subject: [PATCH] fix temp directory location --- package-lock.json | 2 +- package.json | 2 +- src/Helper/download/index.ts | 7 +++++-- src/cli.ts | 5 ++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c01dc02d..e59a7d32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "superplate-cli", - "version": "1.11.1", + "version": "1.11.2", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 11b092f7..ab0cfed2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superplate-cli", - "version": "1.11.1", + "version": "1.11.2", "description": "The frontend boilerplate with superpowers", "license": "MIT", "repository": { diff --git a/src/Helper/download/index.ts b/src/Helper/download/index.ts index 13d10805..258ec4b4 100644 --- a/src/Helper/download/index.ts +++ b/src/Helper/download/index.ts @@ -1,6 +1,6 @@ import { promisify } from "util"; import { exec } from "child_process"; -import { mkdir } from "temp"; +import { mkdirSync } from "temp"; import ghdownload from "github-download"; import gitHubURLParser from "parse-github-url"; @@ -8,7 +8,10 @@ import gitHubURLParser from "parse-github-url"; export const DownloadHelper = { DownloadAndGetPath: async (path: string): Promise => { try { - const tempInfo = await promisify(mkdir)(""); + const tempInfo = mkdirSync({ + dir: process.cwd(), + prefix: ".", + }); await new Promise((resolve, reject) => { const { owner, name, branch } = gitHubURLParser(path); diff --git a/src/cli.ts b/src/cli.ts index 0b2200a5..1b2bea8f 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -2,7 +2,7 @@ import chalk from "chalk"; import clear from "clear"; import path from "path"; import commander from "commander"; -import { cleanupSync } from "temp"; +import { cleanupSync, track } from "temp"; import { Options, SAO } from "sao"; import packageData from "../package.json"; @@ -19,6 +19,9 @@ import { const generator = path.resolve(__dirname, "./"); +// for cleanup temp files +track(); +// const cli = async (): Promise => { clear(); const program = commander