Skip to content

Conversation

@s09289728096
Copy link

In linux, $(pwd) only read the "current working directory path" instead of "absolute path", and this is a bit tricky when the path is from a symbolic link.
For example, we got a openwrt repo at path "/mnt/ssd_500gb/github/openwrt"
If using ln -s /mnt/ssd_500gb/github/openwrt ~/openwrt to link into home directory, in path ~/openwrt, the following command will show:

git rev-parse --show-toplevel	-> /mnt/ssd_500gb/github/openwrt
echo $(pwd)						-> /home/elwin/openwrt
echo $(readlink -f $(pwd))		-> /mnt/ssd_500gb/github/openwrt

Fix this issue to read the realpath of pwd so that when running in a link, morse_setup will find the correct path.

In linux, $(pwd) only read the "current working directory path" instead of "absolute path",and this is a bit tricky when the path is from a symbolic link.
For example, we got a openwrt repo at path "/mnt/ssd_500gb/github/openwrt"
If using "ln -s /mnt/ssd_500gb/github/openwrt ~/openwrt" to link into home directory, in path "~/openwrt," the following command will show:

git rev-parse --show-toplevel	-> /mnt/ssd_500gb/github/openwrt
echo $(pwd)						-> /home/elwin/openwrt
echo $(readlink -f $(pwd))		-> /mnt/ssd_500gb/github/openwrt

Fix this issue to read the realpath of pwd so that when running in a link, morse_setup will find the correct path.

Signed-off-by: Elwin Huang <s09289728096@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant