Skip to main content

Add a function to add a repo to my PATH

ID
43be4c4
date
2024-06-05 21:40:18+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
457d975
message
Add a function to add a repo to my PATH
changed files
2 files, 15 additions, 1 deletion

Changed files

fish_functions/README.md (4085) → fish_functions/README.md (4318)

diff --git a/fish_functions/README.md b/fish_functions/README.md
index 06f3057..2ef946c 100644
--- a/fish_functions/README.md
+++ b/fish_functions/README.md
@@ -51,6 +51,15 @@ cog_helpers.create_description_table(folder_name=folder_name, scripts=functions)
 ]]] -->
 <dl>
   <dt>
+    <a href="https://github.com/alexwlchan/scripts/blob/main/fish_functions/add_repo_to_path.fish">
+      <code>add_repo_to_path.fish</code>
+    </a>
+  </dt>
+  <dd>
+    Add a folder in my ~/repos directory to my PATH
+  </dd>
+
+  <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/fish_functions/append_to_file_if_not_exists.fish">
       <code>append_to_file_if_not_exists.fish</code>
     </a>
@@ -149,4 +158,4 @@ cog_helpers.create_description_table(folder_name=folder_name, scripts=functions)
     Create and activate a new virtual environment
   </dd>
 </dl>
-<!-- [[[end]]] (checksum: e9c834ba6a3e6dce919939efbe5deaad) -->
\ No newline at end of file
+<!-- [[[end]]] (checksum: a3aa157a74c828f8f09dd8705289558a) -->
\ No newline at end of file

fish_functions/add_repo_to_path.fish (0) → fish_functions/add_repo_to_path.fish (224)

diff --git a/fish_functions/add_repo_to_path.fish b/fish_functions/add_repo_to_path.fish
new file mode 100644
index 0000000..ea3b334
--- /dev/null
+++ b/fish_functions/add_repo_to_path.fish
@@ -0,0 +1,5 @@
+function add_repo_to_path --description "Add a folder in my ~/repos directory to my PATH"
+    set repo_name $argv[1]
+
+    echo "set -g -x PATH ~/repos/$repo_name \"\$PATH\"" > ~/.config/fish/conf.d/repos-$repo_name.fish
+end