Я создал файл псевдонима для удержания псевдонима
nano .bash_aliases
, а затем использовал команду
alias ganache='./ganachescript'
Однако,
$ ./ganachescript
08:29:17.571 › Checking for update
08:29:19.052 › Update for version 2.4.0 is not available (latest version: 2.4.0, downgrade is disallowed).
, но если я напишу:
$ ganache
ganache: command not found
Кто-нибудь, пожалуйста, направьте меня.
That's a quite not-correct way to set an alias. The command ./ganachescript
means 'execute the executable file ganachescript
that exists in the current directory'. So the alias would work only when you run the ganache
command in the specific directory where the ganachescript
file is located.
To overcome this you need to use the full path to the ganachescript
file instead as below
alias ganache='/path/to/ganachescript'