From 41aadc91cb729422db8c1f03e382a981e1a1f35b Mon Sep 17 00:00:00 2001 From: ChrisKader Date: Mon, 23 Sep 2024 06:04:28 -0500 Subject: [PATCH] Updates. --- index.js | 5 +++-- src/index.ts | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 631f71a..6ab59f4 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,8 @@ import util from 'util'; import fs from 'fs-extra'; import path from 'path'; import { sortPackageJson } from 'sort-package-json'; -const exec = util.promisify(require('child_process').exec); +import { exec } from 'child_process'; +const execute = util.promisify(exec); const repoUrls = { js: 'https://git.tinkr.site/jeffi/js-tinkrplugin-boilerplate.git', ts: 'https://git.tinkr.site/jeffi/ts-tinkr-plugin-boilerplate.git', @@ -55,7 +56,7 @@ prompts([ ]).then(async ({ name, version, author, description, lang }) => { const packageName = kebabCase(sanitize(name, { replacement: '-' })); console.log(`Creating a Tinkr plugin in ./${packageName}`); - await exec(`git clone ${repoUrls[lang]} ${packageName}`); + await execute(`git clone ${repoUrls[lang]} ${packageName}`); const packageDir = path.join(process.cwd(), packageName); const packageJsonPath = path.join(packageDir, 'package.json'); const { bugs, homepage, keywords, license, repository, ...packageJson } = await fs.readJSON(packageJsonPath); diff --git a/src/index.ts b/src/index.ts index 0c1b20d..18167a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,8 +6,8 @@ import util from 'util'; import fs from 'fs-extra'; import path from 'path'; import { sortPackageJson } from 'sort-package-json'; - -const exec = util.promisify(require('child_process').exec); +import { exec } from 'child_process' +const execute = util.promisify(exec); const repoUrls = { js: 'https://git.tinkr.site/jeffi/js-tinkrplugin-boilerplate.git', @@ -62,7 +62,7 @@ prompts([ console.log(`Creating a Tinkr plugin in ./${packageName}`) - await exec(`git clone ${repoUrls[lang]} ${packageName}`) + await execute(`git clone ${repoUrls[lang]} ${packageName}`) const packageDir = path.join(process.cwd(), packageName) const packageJsonPath = path.join(packageDir, 'package.json')