diff --git a/README.md b/README.md index ba24510b7..be8c8e5f9 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Given a very simple project spec file like this: ```yaml name: My Project -options: +options: bundleIdPrefix: com.myapp targets: MyApp: @@ -117,7 +117,7 @@ This will look for a project spec in the current directory called `project.yml` Use `xcodegen --help` to see the list of options: - **--spec**: An optional path to a `.yml` or `.json` project spec. -- **--project**: An optional path to a directory where the project will be generated. By default this is the current directory. +- **--project**: An optional path to a directory where the project will be generated. By default this is the directory the spec lives in. - **--quiet**: Suppress informational and success messages. By default this is disabled. ## Editing diff --git a/Sources/XcodeGen/main.swift b/Sources/XcodeGen/main.swift index fd2c30cd7..5b4ccd440 100644 --- a/Sources/XcodeGen/main.swift +++ b/Sources/XcodeGen/main.swift @@ -22,7 +22,7 @@ func generate(spec: String, project: String, isQuiet: Bool, justVersion: Bool) { } let specPath = Path(spec).absolute() - let projectPath = Path(project).normalize() + let projectPath = project == "" ? specPath.parent() : Path(project).absolute() if !specPath.exists { fatalError("No project spec found at \(specPath.absolute())")