monowalk 1.1.3-fix → 1.1.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.
@@ -18,23 +18,16 @@ const select_1 = __importDefault(require("@inquirer/select"));
18
18
  const config_1 = require("../utils/config");
19
19
  const path_1 = __importDefault(require("path"));
20
20
  const folder_1 = require("../utils/folder");
21
- const process_1 = require("process");
22
21
  function to() {
23
22
  return __awaiter(this, void 0, void 0, function* () {
24
23
  console.log("Your projects:");
25
- let { content } = (0, config_1.findNearestConfigPath)();
24
+ let { content, rootFolder } = (0, config_1.findNearestConfigPath)();
26
25
  let res = yield (0, select_1.default)({
27
26
  message: "Select a project to open in Visual Studio Code:",
28
27
  choices: Object.keys(content.projects || {}),
29
28
  });
30
29
  let projectPath = content.projects[res];
31
- let fullPath = path_1.default.join((0, process_1.cwd)(), projectPath.replace("./", ""));
32
- let keys = Object.keys(content.projects);
33
- for (let k of keys) {
34
- if (fullPath.includes(content.projects[k].replace("./", ""))) {
35
- fullPath = path_1.default.join((0, process_1.cwd)(), "..", projectPath.replace("./", ""));
36
- }
37
- }
30
+ let fullPath = path_1.default.join(rootFolder, projectPath.replace("./", ""));
38
31
  (0, folder_1.loadFolder)(fullPath);
39
32
  console.log(`Opened project "${fullPath}" in Visual Studio Code.`);
40
33
  });
@@ -39,5 +39,6 @@ function findNearestConfigPath(iterations = 3) {
39
39
  return {
40
40
  content,
41
41
  configPath,
42
+ rootFolder: configPath.split("/").slice(-1).join("/"),
42
43
  };
43
44
  }
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "type": "github",
30
30
  "url": "git+https://github.com/nekoniyah/monowalk.git"
31
31
  },
32
- "version": "1.1.3-fix",
32
+ "version": "1.1.3",
33
33
  "scripts": {
34
34
  "prepublish": "tsc"
35
35
  },