makepack 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -41,6 +41,21 @@ export default async (args) => {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
for (let file of files) {
|
|
44
|
+
// check if the file exists
|
|
45
|
+
if (fs.existsSync(path.join(args.cwd, file.filename))) {
|
|
46
|
+
const { overwrite } = await inquirer.prompt([
|
|
47
|
+
{
|
|
48
|
+
type: "confirm",
|
|
49
|
+
name: 'overwrite',
|
|
50
|
+
message: `The file ${file.filename} already exists, do you want to overwrite it?`,
|
|
51
|
+
default: false
|
|
52
|
+
}
|
|
53
|
+
])
|
|
54
|
+
if (!overwrite) {
|
|
55
|
+
continue
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
44
59
|
fs.writeFileSync(path.join(args.cwd, file.filename), file.content)
|
|
45
60
|
}
|
|
46
61
|
}
|
|
@@ -39,7 +39,10 @@ const makeProjectInformation = async () => {
|
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
// check if the root directory exists
|
|
43
|
+
if (!fs.existsSync(path.join(projectDir.cwd, information.rootdir))) {
|
|
44
|
+
fs.mkdirSync(path.join(projectDir.cwd, information.rootdir))
|
|
45
|
+
}
|
|
43
46
|
|
|
44
47
|
/*
|
|
45
48
|
{
|
package/src/actions/pack.js
CHANGED
|
@@ -65,6 +65,7 @@ const pack = async (args) => {
|
|
|
65
65
|
loader.stop()
|
|
66
66
|
|
|
67
67
|
fs.copyFileSync(path.join(process.cwd(), '/package.json'), path.join(process.cwd(), args.outdir, `/package.json`))
|
|
68
|
+
fs.copyFileSync(path.join(process.cwd(), '/readme.md'), path.join(process.cwd(), args.outdir, `/readme.md`))
|
|
68
69
|
console.log('✅ Production build generated successfully! The package is ready for deployment.');
|
|
69
70
|
|
|
70
71
|
if (args.publish) {
|