evophp 1.0.5 → 1.0.7

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.
Files changed (2) hide show
  1. package/installer.js +3 -7
  2. package/package.json +10 -2
package/installer.js CHANGED
@@ -4,7 +4,6 @@ const { execSync } = require("child_process");
4
4
  const path = require("path");
5
5
  const fs = require("fs");
6
6
  const { readLineAsync } = require("./helpers");
7
- const axios = require("axios");
8
7
 
9
8
  let [, , command, type, name] = process.argv;
10
9
 
@@ -18,8 +17,7 @@ let [, , command, type, name] = process.argv;
18
17
 
19
18
  console.log(`Installing plugin/theme: ${name}...`);
20
19
  try {
21
- const globalPath = require.resolve("evophp");
22
- const pluginPath = path.resolve(path.dirname(globalPath), "install-plugin.js");
20
+ const pluginPath = path.resolve(__dirname, "install-plugin.js");
23
21
  execSync(`node ${pluginPath} ${type} ${name}`, {
24
22
  stdio: "inherit",
25
23
  });
@@ -45,8 +43,7 @@ let [, , command, type, name] = process.argv;
45
43
 
46
44
  console.log(`Creating a new ${type}: ${name}...`);
47
45
  try {
48
- const globalPath = require.resolve("evophp");
49
- const pluginPath = path.resolve(path.dirname(globalPath), "new-plugin.js");
46
+ const pluginPath = path.resolve(__dirname, "new-plugin.js");
50
47
  execSync(`node ${pluginPath} ${type} ${name}`, { stdio: "inherit" });
51
48
  } catch (error) {
52
49
  console.error(`Error creating new ${type}: ${error.message}`);
@@ -62,8 +59,7 @@ let [, , command, type, name] = process.argv;
62
59
 
63
60
  if (type === "plugin") {
64
61
  try {
65
- const globalPath = require.resolve("evophp");
66
- const pluginPath = path.resolve(path.dirname(globalPath), "install-dependencies.js");
62
+ const pluginPath = path.resolve(__dirname, "install-dependencies.js");
67
63
  execSync(`node ${pluginPath} ${name} ${args.join(' ')}`, { stdio: "inherit" });
68
64
  } catch (error) {
69
65
  console.error(`Error installing dependencies: ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evophp",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Installer for the Evolution PHP project",
5
5
  "main": "installer.js",
6
6
  "scripts": {
@@ -11,5 +11,13 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "axios": "^1.7.9"
14
- }
14
+ },
15
+ "files": [
16
+ "installer.js",
17
+ "new-plugin.js",
18
+ "install-plugin.js",
19
+ "install-dependencies.js",
20
+ "helpers.js"
21
+ ]
15
22
  }
23
+