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
93ddd6f2
Commit
93ddd6f2
authored
Nov 17, 2015
by
Derek Willian Stavis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #149 from derekstavis/package-dependencies
Implement automatic dependency resolution
parents
2fa7a5ec
042657cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
lib/require.fish
lib/require.fish
+11
-0
pkg/omf/cli/omf.bundle.install.fish
pkg/omf/cli/omf.bundle.install.fish
+3
-1
pkg/omf/cli/omf.install.fish
pkg/omf/cli/omf.install.fish
+1
-0
pkg/omf/cli/omf.update.fish
pkg/omf/cli/omf.update.fish
+3
-0
No files found.
lib/require.fish
View file @
93ddd6f2
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
# OVERVIEW
# OVERVIEW
# Require a plugin:
# Require a plugin:
# - Autoload its functions and completions.
# - Autoload its functions and completions.
# - Require bundle dependencies.
# - Source its initialization file.
# - Source its initialization file.
# - Emit its initialization event.
# - Emit its initialization event.
#
#
...
@@ -16,8 +17,18 @@ function require -a name
...
@@ -16,8 +17,18 @@ function require -a name
and return 0
and return 0
for path in {$OMF_PATH,$OMF_CONFIG}/pkg/$name
for path in {$OMF_PATH,$OMF_CONFIG}/pkg/$name
test -d $path; or continue
if autoload $path $path/functions $path/completions
if autoload $path $path/functions $path/completions
if test -f $path/bundle
for line in (cat $path/bundle)
test (echo $line | cut -d' ' -f1) = package;
and set dependency (basename (echo $line | cut -d' ' -f2));
and require $dependency
end
end
source $path/init.fish ^/dev/null;
source $path/init.fish ^/dev/null;
or source $path/$name.fish ^/dev/null;
or source $path/$name.fish ^/dev/null;
and emit init_$name $path
and emit init_$name $path
...
...
pkg/omf/cli/omf.bundle.install.fish
View file @
93ddd6f2
function omf.bundle.install
function omf.bundle.install
set bundle $OMF_CONFIG/bundle
test -n "$argv";
and set bundle $argv
or set bundle $OMF_CONFIG/bundle
if test -f $bundle
if test -f $bundle
set packages (omf.packages.list --installed)
set packages (omf.packages.list --installed)
...
...
pkg/omf/cli/omf.install.fish
View file @
93ddd6f2
...
@@ -34,6 +34,7 @@ function omf.install -a name_or_url
...
@@ -34,6 +34,7 @@ function omf.install -a name_or_url
echo (omf::dim)"Installing $install_type $name"(omf::off)
echo (omf::dim)"Installing $install_type $name"(omf::off)
if omf.repo.clone $url $OMF_PATH/$parent_path/$name
if omf.repo.clone $url $OMF_PATH/$parent_path/$name
omf.bundle.install $OMF_PATH/$parent_path/$name/bundle
omf.bundle.add $install_type $name_or_url
omf.bundle.add $install_type $name_or_url
__omf.install.success "$install_type $name"
__omf.install.success "$install_type $name"
...
...
pkg/omf/cli/omf.update.fish
View file @
93ddd6f2
...
@@ -19,6 +19,9 @@ function omf.update -a name
...
@@ -19,6 +19,9 @@ function omf.update -a name
not test -e "$path/.git"; and continue
not test -e "$path/.git"; and continue
omf.repo.pull $path; and set return_success
omf.repo.pull $path; and set return_success
set -q return_success;
and omf.bundle.install $path/bundle
end
end
set -q return_success; and __omf.update.success "$name"
set -q return_success; and __omf.update.success "$name"
...
...
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