mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
fish: rename clone_to_repos function
This commit is contained in:
parent
083ba8a2b0
commit
91219e583e
3 changed files with 3 additions and 3 deletions
14
nix/homeModules/common/fish/functions/c2r.fish
Normal file
14
nix/homeModules/common/fish/functions/c2r.fish
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
function c2r \
|
||||
--description "[C]lone a [r]epo to ~/home/{username}/r"
|
||||
|
||||
if not count $argv >/dev/null
|
||||
echo "Git url needed"
|
||||
end
|
||||
|
||||
set name_repo (echo $argv | sed -E 's/.*[:\\/]([^\\/]+)\\/([^\\/]+?)(:?\\.git)$/\1 \2/')
|
||||
set name (echo $name_repo | cut -d ' ' -f1)
|
||||
set repo (echo $name_repo | cut -d ' ' -f2)
|
||||
mkdir -p $REPO_PATH/$name
|
||||
git clone $argv $REPO_PATH/$name/$repo
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue