SwiftyMocky:ShellOut 遇到错误
SwiftyMocky: ShellOut encountered an error
我在使用 SwiftyMocky
生成模拟时遇到以下问题
╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝
Running at: <path-to-project>SomeProject
Processing mock: SomeTests ...
❌ Error: ShellOut encountered an error
Status code: 1
Message: "Unknown Arguments: <path>/.mocky/.config.yml.tmp
Options:
--watch [default: false] - Watch template for changes and regenerate as needed.
--disableCache [default: false] - Stops using cache.
--verbose [default: false] - Turn on verbose logging
--quiet [default: false] - Turn off any logging, only emmit errors.
--prune [default: false] - Remove empty generated files
--sources - Path to a source swift files. File or Directory.
--exclude-sources - Path to a source swift files to exclude. File or Directory.
--templates - Path to templates. File or Directory.
--exclude-templates - Path to templates to exclude. File or Directory.
--output - Path to output. File or Directory. Default is current path.
--config - Path to config file. File or Directory. Default is current path.
--force-parse - File extensions that Sourcery will be forced to parse, even if they were generated by Sourcery.
--args - Custom values to pass to templates.
--ejsPath - Path to EJS file for JavaScript templates."
Output: ""
我已尝试将 sourcery
版本更新到 0.18.0 并卸载 sourcery
和 SwiftyMocky
并重新安装。
如有任何帮助,我们将不胜感激。
已更新 SwiftyMocky doctor
日志
✗ SwiftyMocky doctor
╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝
1. Inspecting tools dependencies:
✅ Mint available
✅ Sourcery is available through Mint
2. Inspecting Mockfile:
✅ Mockfile exists
✅ Mockfile contains mocks definitions
3. Linting 'ServicingTests' mock:
✅ Output file exists
Targets:
✅ Mock defines targets correctly
✅ All targets include
'./<project>/ServicingTests/ServicingTests.Mock.generated.swift' file.
Sources:
✅ Sources are defined correctly
Imports:
✅ Testable imports are defined
✅ Imports are defined
此外,我的一位同事能够生成模拟。他说当他运行 SwiftyMocky generate
命令时它不会生成 <path>/.mocky/.config.yml.tmp
.
唯一的区别是 macOS
版本。我是 运行 10.15.4
而他是 运行 10.15.3
.
我终于解决了这个问题,这是一件愚蠢的事情。我在项目路径中有一个 space
。我所需要的只是从项目路径中删除 space
,它就像一个魅力。
我在使用 SwiftyMocky
生成模拟时遇到以下问题
╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝
Running at: <path-to-project>SomeProject
Processing mock: SomeTests ...
❌ Error: ShellOut encountered an error
Status code: 1
Message: "Unknown Arguments: <path>/.mocky/.config.yml.tmp
Options:
--watch [default: false] - Watch template for changes and regenerate as needed.
--disableCache [default: false] - Stops using cache.
--verbose [default: false] - Turn on verbose logging
--quiet [default: false] - Turn off any logging, only emmit errors.
--prune [default: false] - Remove empty generated files
--sources - Path to a source swift files. File or Directory.
--exclude-sources - Path to a source swift files to exclude. File or Directory.
--templates - Path to templates. File or Directory.
--exclude-templates - Path to templates to exclude. File or Directory.
--output - Path to output. File or Directory. Default is current path.
--config - Path to config file. File or Directory. Default is current path.
--force-parse - File extensions that Sourcery will be forced to parse, even if they were generated by Sourcery.
--args - Custom values to pass to templates.
--ejsPath - Path to EJS file for JavaScript templates."
Output: ""
我已尝试将 sourcery
版本更新到 0.18.0 并卸载 sourcery
和 SwiftyMocky
并重新安装。
如有任何帮助,我们将不胜感激。
已更新 SwiftyMocky doctor
日志
✗ SwiftyMocky doctor
╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝
1. Inspecting tools dependencies:
✅ Mint available
✅ Sourcery is available through Mint
2. Inspecting Mockfile:
✅ Mockfile exists
✅ Mockfile contains mocks definitions
3. Linting 'ServicingTests' mock:
✅ Output file exists
Targets:
✅ Mock defines targets correctly
✅ All targets include
'./<project>/ServicingTests/ServicingTests.Mock.generated.swift' file.
Sources:
✅ Sources are defined correctly
Imports:
✅ Testable imports are defined
✅ Imports are defined
此外,我的一位同事能够生成模拟。他说当他运行 SwiftyMocky generate
命令时它不会生成 <path>/.mocky/.config.yml.tmp
.
唯一的区别是 macOS
版本。我是 运行 10.15.4
而他是 运行 10.15.3
.
我终于解决了这个问题,这是一件愚蠢的事情。我在项目路径中有一个 space
。我所需要的只是从项目路径中删除 space
,它就像一个魅力。