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
7bf108b8
Commit
7bf108b8
authored
Mar 10, 2013
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simpler support for local npm packages
parent
9caa7af7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
28 deletions
+1
-28
plugins/node/node.load
plugins/node/node.load
+1
-28
No files found.
plugins/node/node.load
View file @
7bf108b8
### Functions
function __remove_local_npm_binaries_from_path
set -l count 1
for path in $PATH
if echo $path | grep 'node_module' >/dev/null
set -e PATH[$count]
else
set count (math $count + 1)
end
end
end
function __add_local_npm_binaries_to_path
for path in $PWD/node_modules/*/bin
set PATH $path $PATH
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
__remove_local_npm_binaries_from_path
__add_local_npm_binaries_to_path
end
set PATH ./node_modules/.bin $PATH
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