The script is setting up / extending some environment variable which are necessary to find artifacts in your custom location (~/catkin_ws). You can call env before and after sourcing the script to see the differences.
I assume you anyway source the file /opt/ros/lunar/setup.bash. In that case you could install the package into /opt/ros/lunar. Then it wouldn't require any additional file to be sourced. Assuming your workspace only contains that package you can install it like this: catkin_make_isolated --install --cmake-args -DCMAKE_INSTALL_PREFIX=/opt/ros/lunar (for the install step you will need root permission to copy the files to /opt/ros/lunar). You should be careful though since that might "interact" / "interfere" with Debian packages installed to that location (disclaimer: I haven't run that command and checked if it works or does any harm in your case).
The script is setting up / extending some environment variable which are necessary to find artifacts in your custom location (~/catkin_ws). You can call env before and after sourcing the script to see the differences.
I assume you anyway source the file /opt/ros/lunar/setup.bash. In that case you could install the package into /opt/ros/lunar. Then it wouldn't require any additional file to be sourced. Assuming your workspace only contains that package you can install it like this: catkin_make_isolated --install --cmake-args -DCMAKE_INSTALL_PREFIX=/opt/ros/lunar (for the install step you will need root permission to copy the files to /opt/ros/lunar). You should be careful though since that might "interact" / "interfere" with Debian packages installed to that location (disclaimer: I haven't run that command and checked if it works or does any harm in your case).case). But this should give you some idea how to approach it.