Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create symlink within intellij project

I am attempting to create a symlink within my project in Intellij, I want to link the index.html from my react folder into my templates folder. I am using this command :

ln -s react-app/build/index.html site/src/ratpack/templates/index.html

However when I run gradle build I get the error

Could not list contents of /home/xxx/dev/football/site/src/ratpack/templates/index.html Couldnt follow symbolic link

Am I creating this symlink wrong? I am running the command from the root of my project.

like image 365
Elliot Pohath Avatar asked Nov 15 '25 02:11

Elliot Pohath


1 Answers

Use file command to check if that file exists and to know what it is.

file /home/xxx/dev/football/site/src/ratpack/templates/index.html

if it exists, remove the current broken link with unlink command and then create a new one. I suggest to use absolute paths rather than relative paths to create the symbolic link to avoid where are you running the command from.

You are using the command correctly if you are using in the following way:

ln -s target link_name

like image 86
Pablo Hinojosa Avatar answered Nov 17 '25 20:11

Pablo Hinojosa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!