From f5fa6a50c14252356f03136a5712124817c6903c Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Wed, 27 Dec 2017 15:30:16 +0800 Subject: [PATCH] made the default for --project argument the spec directory --- README.md | 4 ++-- Sources/XcodeGen/main.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ba24510b..be8c8e5f 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 fd2c30cd..5b4ccd44 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())")