Skip to content

Commit

Permalink
fix temp directory location
Browse files Browse the repository at this point in the history
  • Loading branch information
omeraplak committed Dec 9, 2022
1 parent e10b85c commit e682f88
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superplate-cli",
"version": "1.11.1",
"version": "1.11.2",
"description": "The frontend boilerplate with superpowers",
"license": "MIT",
"repository": {
Expand Down
7 changes: 5 additions & 2 deletions src/Helper/download/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
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";

export const DownloadHelper = {
DownloadAndGetPath: async (path: string): Promise<string> => {
try {
const tempInfo = await promisify(mkdir)("");
const tempInfo = mkdirSync({
dir: process.cwd(),
prefix: ".",
});

await new Promise((resolve, reject) => {
const { owner, name, branch } = gitHubURLParser(path);
Expand Down
5 changes: 4 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -19,6 +19,9 @@ import {

const generator = path.resolve(__dirname, "./");

// for cleanup temp files
track();
//
const cli = async (): Promise<void> => {
clear();
const program = commander
Expand Down

0 comments on commit e682f88

Please sign in to comment.