milkee 0.0.8 → 0.0.10

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/dist/main.js CHANGED
@@ -24,24 +24,34 @@
24
24
 
25
25
  // async
26
26
  setup = async function() {
27
- var CONFIG_TEMPLATE, TEMPLATE_PATH, check, error;
27
+ var CONFIG_TEMPLATE, TEMPLATE_PATH, check, error, pstat, stat;
28
+ pstat = "created";
29
+ stat = "create";
28
30
  if (fs.existsSync(CONFIG_PATH)) {
29
31
  consola.warn(`\`${CONFIG_FILE}\` already exists in this directory.`);
30
32
  check = (await consola.prompt("Do you want to reset `coffee.config.js`?", {
31
33
  type: "confirm"
32
34
  }));
33
35
  if (check !== true) {
36
+ consola.info("Cancelled.");
34
37
  return;
38
+ } else {
39
+ fs.rmSync(CONFIG_PATH, {
40
+ recursive: true,
41
+ force: true
42
+ });
43
+ pstat = "reset";
44
+ stat = "reset";
35
45
  }
36
46
  }
37
47
  try {
38
48
  TEMPLATE_PATH = path.join(__dirname, '..', 'temp', 'coffee.config.js');
39
49
  CONFIG_TEMPLATE = fs.readFileSync(TEMPLATE_PATH, 'utf-8');
40
50
  fs.writeFileSync(CONFIG_PATH, CONFIG_TEMPLATE);
41
- return consola.success(`Successfully created \`${CONFIG_FILE}\`!`);
51
+ return consola.success(`Successfully ${pstat} \`${CONFIG_FILE}\`!`);
42
52
  } catch (error1) {
43
53
  error = error1;
44
- consola.error(`Failed to create \`${CONFIG_FILE}\`:`, error);
54
+ consola.error(`Failed to ${stat} \`${CONFIG_FILE}\`:`, error);
45
55
  return consola.info(`Template file may be missing from the package installation at \`${TEMPLATE_PATH}\``);
46
56
  }
47
57
  };
@@ -125,7 +135,9 @@
125
135
  commandParts.push(`\"${config.entry}\"`);
126
136
  command = commandParts.filter(Boolean).join(' ');
127
137
  if (milkeeOptions.confirm) {
128
- toContinue = (await consola.prompt("Do you want to continue?"));
138
+ toContinue = (await consola.prompt("Do you want to continue?", {
139
+ type: "confirm"
140
+ }));
129
141
  if (toContinue !== true) {
130
142
  return;
131
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "milkee",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "A simple CoffeeScript build tool with coffee.config.js",
5
5
  "main": "dist/main.js",
6
6
  "bin": {
@@ -3,8 +3,8 @@ module.exports = {
3
3
  // This can be a single file or a directory.
4
4
  entry: 'src',
5
5
  // The output for the compiled JavaScript files.
6
- // If 'join' is true, this should be a single file path (e.g., 'dist/app.js').
7
- // If 'join' is false, this should be a directory (e.g., 'dist').
6
+ // If 'options.join' is true, this should be a single file path (e.g., 'dist/app.js').
7
+ // If 'options.join' is false, this should be a directory (e.g., 'dist').
8
8
  output: 'dist',
9
9
  // (Optional) Additional options for the CoffeeScript compiler.
10
10
  // See `coffee --help` for all available options.
@@ -26,7 +26,7 @@ module.exports = {
26
26
  // Before compiling, reset the directory.
27
27
  // refresh: false,
28
28
  // Before compiling, confirm "Do you want to Continue?"
29
- // confirm: false
29
+ // confirm: false,
30
30
  },
31
31
  plugins: []
32
32
  },