Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global install and uninstall #41

Merged
merged 5 commits into from
Dec 20, 2017
Merged

Global install and uninstall #41

merged 5 commits into from
Dec 20, 2017

Conversation

yonaskolb
Copy link
Owner

Resolves #1

This allows installing a package globally. At the moment this is behind a --global flag, which may change to the default in the future.
There is also an obligatory uninstall command

@yonaskolb
Copy link
Owner Author

@orta @SDGGiesbrecht

@yonaskolb
Copy link
Owner Author

I'm also thinking of changing the mint path from /usr/local/lib/mint to ~/.mint. Now is a good time to do it as we will be exporting to an install path within that.

let existingString: String = try file.read()
if !existingString.contains(exportSection) {
let newString = "\(existingString)\n\n\(exportSection)"
try file.write(newString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth logging out that this is happening, but this makes sense to me 👍

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


try files.forEach {
let file = Path($0).absolute()
if file.exists {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the use of a shell guarantees it will have a log‐on script. If the user has not configured anything yet, I do not know if the file would just be empty or completely non‐existent.

It is a clever way of checking which shells the user likely prefers, so I recommend keeping it this way for now unless someone files a bug.

@yonaskolb yonaskolb merged commit 11e4c01 into master Dec 20, 2017
@yonaskolb yonaskolb deleted the global_install branch December 20, 2017 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants