legacy-python-cli icon indicating copy to clipboard operation
legacy-python-cli copied to clipboard

Log time from fish shell improvements to send git repository main folder as project

Open claudiu-marginean opened this issue 5 years ago • 1 comments

Hi,

I was installing and configuring the fish integration and did a bit o work to extract the git repository main folder as project.

This is from your site guide:

set -l project

if echo (pwd) | grep -qEi "^/Users/$USER/Sites/"
    set  project (echo (pwd) | sed "s#^/Users/$USER/Sites/\\([^/]*\\).*#\\1#")
else
    set  project "Terminal"
end

And I made a change and if I am into a git repository to send the root folder of the repository as project:

	set -l project

	if git::is_repo
			set wp_root_folder (command git rev-parse --show-toplevel ^/dev/null)
			set wp_parent_root_folder (dirname $wp_root_folder)
			set project (echo $wp_root_folder | sed -e "s|$wp_parent_root_folder/||")
	else
	    set  project "Terminal"
	end

claudiu-marginean avatar May 20 '20 21:05 claudiu-marginean

@alanhamlett it changes a bit the logic from initial version. Is it under consideration?

gandarez avatar Oct 20 '20 19:10 gandarez