-
Notifications
You must be signed in to change notification settings - Fork 19
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
Regression when specifying a template_file_path
#37
Comments
Okay, so the problem seems to be that the Prefire binary isn't aware of what the right path should be. I've managed to get it working here piggybacking on the config file URL but perhaps you have an idea for a cleaner solution. |
Fixed in: #39 |
We need to reopen this because it still doesn't work for swfit packages e.g. element-hq/compound-ios#61 and neither does my original fix from here so I'm not entirely sure what the problem is. We were relying on it to set default perceptual precission to |
This might help, the configuration isn't picked up when running directly through
|
I got it working by using static func load(from configPath: String?, testTargetPath: String?, verbose: Bool) -> Config? {
- let possibleConfigPaths = ConfigPathBuilder.possibleConfigPaths(for: configPath, testTargetPath: testTargetPath)
+ var possibleConfigPaths = [String]()
+
+ if let configPath {
+ possibleConfigPaths = [URL(filePath: configPath).appending(path: ".prefire.yml").path()]
+ }
for path in possibleConfigPaths {
- guard let configUrl = URL(string: Constants.fileMark + path),
- FileManager.default.fileExists(atPath: configUrl.path),
+
+ let configUrl = URL(filePath: path)
+
+ print("π’ Checking url: \(configUrl)")
+
+ guard FileManager.default.fileExists(atPath: configUrl.path),
let configDataString = try? String(contentsOf: configUrl, encoding: .utf8) else { continue }
if verbose {
vs what the current version does
|
- rewrite the ConfigPathBuilder to always build absolute (correct) paths to the various places where `.prefire.yml` can be - update the tests to take this into account - change the Config to always use filePaths
- rewrite the ConfigPathBuilder to always build absolute (correct) paths to the various places where `.prefire.yml` can be - update the tests to take this into account - change the Config to always use filePaths
Fixes #37 - Build correct config file paths, update tests
Context π΅οΈββοΈ
Setup the Prefire example project to use a
- template_file_path: PreviewTests.stencil
, wherePreviewTests.stencil
is just a copy of the default template next toPreFireExample.xcodeproj
What π±
Specifying a
template_file_path
doesn't seem to be working anymore resulting in adoes not exist or is not readable
errorProposal π
Let's try to fix it maybe π
The text was updated successfully, but these errors were encountered: