diff --git a/tabby-electron/package.json b/tabby-electron/package.json index 15b00fc3..30525c13 100644 --- a/tabby-electron/package.json +++ b/tabby-electron/package.json @@ -24,7 +24,7 @@ "electron-promise-ipc": "^2.2.4", "ps-node": "^0.1.6", "tmp-promise": "^3.0.2", - "hasbin": "^1.2.3", + "which": "^3.0.0", "winston": "^3.3.3" } } diff --git a/tabby-electron/src/shells/windowsStock.ts b/tabby-electron/src/shells/windowsStock.ts index 836efbdb..e2eaafa4 100644 --- a/tabby-electron/src/shells/windowsStock.ts +++ b/tabby-electron/src/shells/windowsStock.ts @@ -1,6 +1,6 @@ import * as path from 'path' import * as fs from 'fs/promises' -import hasbin from 'hasbin' +import * as which from 'which' import { Injectable } from '@angular/core' import { HostAppService, Platform, ConfigService } from 'tabby-core' import { ElectronService } from '../services/electron.service' @@ -73,7 +73,7 @@ export class WindowsStockShellsProvider extends WindowsBaseShellProvider { private async getPowerShellPath () { for (const name of ['pwsh.exe', 'powershell.exe']) { - if (await new Promise(resolve => hasbin(name, resolve))) { + if (await which(name, { nothrow: true })) { return name } } diff --git a/tabby-electron/yarn.lock b/tabby-electron/yarn.lock index 6a0b80d8..d3a74a84 100644 --- a/tabby-electron/yarn.lock +++ b/tabby-electron/yarn.lock @@ -21,11 +21,6 @@ async@^3.2.3: resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== -async@~1.5: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w== - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -209,13 +204,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hasbin@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/hasbin/-/hasbin-1.2.3.tgz#78c5926893c80215c2b568ae1fd3fcab7a2696b0" - integrity sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg== - dependencies: - async "~1.5" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -296,6 +284,11 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + kuler@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" @@ -515,6 +508,13 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/which/-/which-3.0.0.tgz#a9efd016db59728758a390d23f1687b6e8f59f8e" + integrity sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ== + dependencies: + isexe "^2.0.0" + winston-transport@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa"