Skip to content

Commit

Permalink
remove more tempy references
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Aug 7, 2024
1 parent 9859a6c commit 66a5886
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions scripts/sandbox/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from '../utils/constants';
import * as ghActions from '@actions/core';
import { dedent } from 'ts-dedent';
import { temporaryDirectory } from '../../code/core/src/common/utils/cli';

const isCI = process.env.GITHUB_ACTIONS === 'true';

Expand Down Expand Up @@ -96,8 +97,7 @@ const addStorybook = async ({
const beforeDir = join(baseDir, BEFORE_DIR_NAME);
const afterDir = join(baseDir, AFTER_DIR_NAME);

const { temporaryDirectory } = await import('tempy');
const tmpDir = temporaryDirectory();
const tmpDir = await temporaryDirectory();

try {
await copy(beforeDir, tmpDir);
Expand Down Expand Up @@ -173,7 +173,6 @@ const runGenerators = async (
console.log(`🤹‍♂️ Generating sandboxes with a concurrency of ${1}`);

const limit = pLimit(1);
const { temporaryDirectory } = await import('tempy');

const generationResults = await Promise.allSettled(
generators.map(({ dirName, name, script, expected, env }) =>
Expand All @@ -190,7 +189,7 @@ const runGenerators = async (
await emptyDir(baseDir);

// We do the creation inside a temp dir to avoid yarn container problems
const createBaseDir = temporaryDirectory();
const createBaseDir = await temporaryDirectory();
if (!script.includes('pnp')) {
await setupYarn({ cwd: createBaseDir });
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/sandbox/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getTemplatesData, renderTemplate } from './utils/template';
import { commitAllToGit } from './utils/git';
import { REPROS_DIRECTORY } from '../utils/constants';
import { glob } from 'glob';
import { temporaryDirectory } from '../../code/core/src/common/utils/cli';

export const logger = console;

Expand Down Expand Up @@ -99,8 +100,7 @@ if (!existsSync(REPROS_DIRECTORY)) {
}

async function main() {
const { temporaryDirectory } = await import('tempy');
const tmpFolder = temporaryDirectory();
const tmpFolder = await temporaryDirectory();
logger.log(`⏱ Created tmp folder: ${tmpFolder}`);

const options = program.opts() as PublishOptions;
Expand Down

0 comments on commit 66a5886

Please sign in to comment.