简体   繁体   中英

Link Codeception Vendor Path with Linux

Right now I have a project here:

/srv/www/web/src/private/protected

It has a /vendors/ folder with /codeception in it. I have to currently do:

./vendor/codeception/codeception/codecept run

How can I link this directory/command 'codecept' so I don't have to type the absolute path every time?

I want:

codecept run

Instead of:

./vendor/codeception/codeception/codecept run

In your project folder you could

ln -s vendor/codeception/codeception/codecept .

to create a symlink in the current folder.

concatenate it to $PATH environment variable

PATH=$PATH:full_path_to_script

$PATH is an environment veritable used to find commands/scripts in wanted paths.

each time you are looking for a script or command it looks at the Paths that are listed in this variable

see your paths with:

  ~> echo $PATH 

我添加了这样的符号链接:sudo ln -s / srv / www / web / src / private / protected / vendor / codeception / codeception / codecept / usr / local / bin / codecept

Edit your ~/.bashrc (or ~/.bash_profile) . Add the following:

export PATH=$PATH:bin:vendor/bin

This will allow you to run any executables in both the bin/ and vendor/bin folders without having to cd into them.

You need to close and reopen your terminal for the change to take effect!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM