-
Notifications
You must be signed in to change notification settings - Fork 123
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
Allow running offline without specified version #166
Conversation
Inform users about local fallback
@yonaskolb yes of course! I replaced the path logic to determine currently installed versions with the cache of #170, but I am not sure if this part is fine. |
Sources/MintKit/Mint.swift
Outdated
let metadata = try readMetadata() | ||
let linkedExecutables = getLinkedExecutables() | ||
let cache = try Cache(path: packagesPath, metadata: metadata, linkedExecutables: linkedExecutables) | ||
|
||
guard let installedVersions = cache.packages | ||
.first(where: { $0.gitRepo == package.repo })? | ||
.versionDirs.map({ $0.version }), | ||
let fallbackVersion = installedVersions.first else { | ||
throw MintError.repoNotFound(package.gitPath) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this logic relies on the changes of #170. Is it fine to instantiate the Cache in here?
It’s more likely to be the latest version
@vknabel could you add a changelog entry as well |
@yonaskolb oh yes, of course! |
This doesn't seem to work in the latest version. If I run it locally the command fails @vknabel @yonaskolb. |
When the version cannot be resolved while being offline, this PR will try to find locally installed versions. It will try to use the latest version.
This fixes #164