Skip to content

Commit

Permalink
[#76] - add xpm list
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Jan 26, 2021
1 parent 8ce9a0f commit 122ec82
Show file tree
Hide file tree
Showing 4 changed files with 584 additions and 2 deletions.
113 changes: 113 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,119 @@
"console": "internalConsole",
"sourceMaps": false
},
{
"type": "node",
"request": "launch",
"name": "xpm uninstall xmake",
"program": "${workspaceRoot}/bin/xpm.js",
"stopOnEntry": true,
"args": [
"uninstall",
"xmake",
"-dd",
"-C",
"/Users/ilg/tmp/tt"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"skipFiles": [
"async_hooks.js",
"inspector_async_hook.js"
],
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"sourceMaps": false
},
{
"type": "node",
"request": "launch",
"name": "xpm uninstall cmake",
"program": "${workspaceRoot}/bin/xpm.js",
"stopOnEntry": true,
"args": [
"uninstall",
"@xpack-dev-tools/cmake",
"-dd",
"-C",
"/Users/ilg/tmp/tt"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"skipFiles": [
"async_hooks.js",
"inspector_async_hook.js"
],
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"sourceMaps": false
},
{
"type": "node",
"request": "launch",
"name": "xpm ls",
"program": "${workspaceRoot}/bin/xpm.js",
"stopOnEntry": true,
"args": [
"list",
"-dd",
"-C",
"/Users/ilg/tmp/tt"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"skipFiles": [
"async_hooks.js",
"inspector_async_hook.js"
],
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"sourceMaps": false
},
{
"type": "node",
"request": "launch",
"name": "xpm ls -g",
"program": "${workspaceRoot}/bin/xpm.js",
"stopOnEntry": true,
"args": [
"list",
"-dd",
"-g"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"skipFiles": [
"async_hooks.js",
"inspector_async_hook.js"
],
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"sourceMaps": false
},
{
"type": "node",
"request": "launch",
Expand Down
3 changes: 3 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ class Xpm extends CliApplication {
CliOptions.addCommand(
['link', 'lnk'],
'lib/xpm/link.js')
CliOptions.addCommand(
['list', 'ls', 'll'],
'lib/xpm/list.js')
CliOptions.addCommand(
['uninstall', 'un', 'uni', 'unin', 'unintsall', 'unlink', 'rm', 'r'],
'lib/xpm/uninstall.js')
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/xpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ class Xpack {
}
}

async isFolderPackage (folder) {
const jsonPath = path.join(folder, 'package.json')
async isFolderPackage (folderPath) {
const jsonPath = path.join(folderPath, 'package.json')

try {
const fileContent = await fsPromises.readFile(jsonPath)
Expand Down
Loading

0 comments on commit 122ec82

Please sign in to comment.