Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
9caa7af7
Commit
9caa7af7
authored
Mar 10, 2013
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for local npm packages when loading shell
parent
fadb1fe4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
plugins/node/node.load
plugins/node/node.load
+18
-8
No files found.
plugins/node/node.load
View file @
9caa7af7
if test -d /usr/local/share/npm/bin
### Functions
set PATH /usr/local/share/npm/bin $PATH
function __remove_local_npm_binaries_from_path
end
function __check_node_project --on-variable PWD --description 'Setup local npm binaries on directory change'
status --is-command-substitution; and return
set -l count 1
set -l count 1
for path in $PATH
for path in $PATH
...
@@ -14,10 +9,25 @@ function __check_node_project --on-variable PWD --description 'Setup local npm b
...
@@ -14,10 +9,25 @@ function __check_node_project --on-variable PWD --description 'Setup local npm b
set count (math $count + 1)
set count (math $count + 1)
end
end
end
end
end
function __add_local_npm_binaries_to_path
for path in $PWD/node_modules/*/bin
for path in $PWD/node_modules/*/bin
set PATH $path $PATH
set PATH $path $PATH
end
end
end
### Main program
if test -d /usr/local/share/npm/bin
set PATH /usr/local/share/npm/bin $PATH
end
__add_local_npm_binaries_to_path
function __check_node_project --on-variable PWD --description 'Setup local npm binaries on directory change'
status --is-command-substitution; and return
set -e count
__remove_local_npm_binaries_from_path
__add_local_npm_binaries_to_path
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment