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

Error: swiftgen.yml is not a config file #1088

Open
Gob-Lin opened this issue Nov 6, 2023 · 4 comments
Open

Error: swiftgen.yml is not a config file #1088

Gob-Lin opened this issue Nov 6, 2023 · 4 comments

Comments

@Gob-Lin
Copy link

Gob-Lin commented Nov 6, 2023

Hello there. I have installed v 6.6.2 via homebrew and my run script is the following:

`export PATH="$PATH:/opt/homebrew/bin"

if which swiftgen >/dev/null; then
swiftgen
else
"echo: Swiftgen not found"
fi`

However I receive this error:

Error: swiftgen.ymlis not a config file Usage: swiftgen config run [--config <config>] [--quiet] [--normal] [--verbose] See 'swiftgen config run --help' for more information. Command PhaseScriptExecution failed with a nonzero exit code
Am I doing anything wrong?

Thank you!

@Lobsterrinho
Copy link

Hi mate, try to move .yml to folder which upper one

@Gob-Lin
Copy link
Author

Gob-Lin commented Nov 8, 2023

Hello Lobsterrinho! I tried to move the swiftgen.yml file up one folder, but now I get:
The file “swiftgen.yml” couldn’t be opened because you don’t have permission to view it.

UPDATE: Solved setting ENABLE_USER_SCRIPT_SANDBOXING to false.

@Lobsterrinho
Copy link

check pls what u see in Project -> Build settings -> User Script Sandboxing
If YES, try to switch on NO
Also u can have such error if name of ur project include spaces or hyphens
And try to move .yml in root folder of ur project

@davita00101110dmg
Copy link

Quite late, but if you don't want to move your .yml and .stencil files at the root of project folder, you should modify

  1. Your bash command
    if which swiftgen >/dev/null; then
    swiftgen config run --config /path-to-your-swiftgen.yml-file/swiftgen.yml
    else
    "echo: Swiftgen not found"
    fi`

  2. In swiftgen.yml file
    input_dir: /path-to-your-project/input-folder
    output_dir: /path-to-your-project/output-folder

And now you can move your swiftgen and stencil files wherever you want :)

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

No branches or pull requests

3 participants