|
|
|
@ -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); |
|
|
|
|