I have this fish function:
function createOrOpenBikeFile
set bike_file (find . -name "*.bike" | head -n 1)
if test -n "$bike_file"
open -a "Bike" "$bike_file"
else
set dir_name (basename (pwd))
set new_file "$dir_name.bike"
touch "$new_file"
open -a "Bike" "$new_file"
end
end
This basically in current folder, either opens a .bike
file or if it does not find any .bike
file, it will create a .bike
file where name is the folder name I am currently in.
This works great except one thing. If I do create a .bike
file this way, via this touch
command. When it gets opened I see this on top:
However if I create a file via cmd+n
in app itself like so:
I will see this:
No .bike
shown on top in window name.
How can I achieve latter behavior with the creation of the file from terminal?
Thank you.