diff --git a/.changes/fix-commands.md b/.changes/fix-commands.md new file mode 100644 index 00000000..76ddf6ca --- /dev/null +++ b/.changes/fix-commands.md @@ -0,0 +1,5 @@ +--- +'tauri-vscode': 'patch' +--- + +Fix extensions commands not working with `EISDIR` error. diff --git a/src/extension.ts b/src/extension.ts index 320c5185..651cb0b9 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -241,11 +241,11 @@ interface PackageJson { } } -function __getPackageJson(packageJsonPath: string): PackageJson | null { - const packagePath = path.join(packageJsonPath, 'package.json') +function __getPackageJson(appDir: string): PackageJson | null { + const packageJsonPath = path.join(appDir, 'package.json') if (fs.existsSync(packageJsonPath)) { - const packageStr = fs.readFileSync(packageJsonPath).toString() - return JSON.parse(packageStr) as PackageJson + const packageJsonStr = fs.readFileSync(packageJsonPath).toString() + return JSON.parse(packageJsonStr) as PackageJson } else { return null }