Skip to content
Browse files

added support for installing/symlinking bin_files in package system

  • Loading branch information...
1 parent 65a5ddb commit 5531d300b59b56a57dbac644eff3fdc36654ac43 @bakkdoor committed Apr 27, 2012
Showing with 15 additions and 0 deletions.
  1. +1 −0 lib/package.fy
  2. +14 −0 lib/package/installer.fy
View
1 lib/package.fy
@@ -29,6 +29,7 @@ class Fancy Package {
DEFAULT_FANCY_ROOT = ENV["HOME"] ++ "/.fancy"
DEFAULT_PACKAGES_PATH = DEFAULT_FANCY_ROOT ++ "/packages"
DEFAULT_PACKAGES_LIB_PATH = DEFAULT_PACKAGES_PATH ++ "/lib"
+ DEFAULT_PACKAGES_BIN_PATH = DEFAULT_PACKAGES_PATH ++ "/bin"
def self install: package_name version: version ('latest) {
"""
View
14 lib/package/installer.fy
@@ -37,6 +37,7 @@ class Fancy Package {
Directory create!: $ Fancy Package DEFAULT_FANCY_ROOT
Directory create!: $ Fancy Package DEFAULT_PACKAGES_PATH
Directory create!: $ Fancy Package DEFAULT_PACKAGES_LIB_PATH
+ Directory create!: $ Fancy Package DEFAULT_PACKAGES_BIN_PATH
Directory create!: $ Fancy Package DEFAULT_PACKAGES_PATH ++ "/downloads"
}
@@ -149,6 +150,10 @@ class Fancy Package {
@install_path + "/lib"
}
+ def bin_path {
+ @install_path + "/bin"
+ }
+
def rename_dir: dirname {
"""
Renames a given directory to a common way within the install path.
@@ -196,6 +201,15 @@ class Fancy Package {
}
}
+ spec bin_files each: |bf| {
+ basename = File basename(bf)
+ orig_path = "#{installed_path}/#{bf}"
+ link_path = "#{bin_path}/#{basename}"
+ "Creating symlink #{link_path} for #{orig_path}" println
+ { File delete: link_path } if: $ File exists?: link_path
+ File symlink(orig_path, link_path)
+ }
+
spec dependencies each: |dep| {
Package install: dep
}

0 comments on commit 5531d30

Please sign in to comment.
Something went wrong with that request. Please try again.