Skip to content

Commit

Permalink
delete symlinks to bin-files when uninstalling a package
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkdoor committed Jul 17, 2012
1 parent 49c8c7e commit b83f7dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/package/handler.fy
Expand Up @@ -52,5 +52,11 @@ class Fancy Package {
def bin_path {
@install_path + "/bin"
}

def installed_bin_symlinks: spec {
spec bin_files map: |bf| {
"#{bin_path}/#{File basename(bf)}"
}
}
}
}
7 changes: 7 additions & 0 deletions lib/package/uninstaller.fy
Expand Up @@ -9,6 +9,7 @@ class Fancy Package {
Specification delete_specification: spec from: $ Fancy Package package_list_file
delete_package_dir
delete_lib_file: (spec package_name)
delete_bin_files: (installed_bin_symlinks: spec)
"Successfully uninstalled package #{spec package_name} with version: #{spec version}." println
} else: {
System abort: "No package found for #{@package_name} with version '#{@version}'."
Expand All @@ -28,5 +29,11 @@ class Fancy Package {
"Deleting: #{lib_file}" println
File delete!: lib_file
}

def delete_bin_files: bin_files {
bin_files each: |bf| {
File delete!: bf
}
}
}
}

0 comments on commit b83f7dc

Please sign in to comment.