Skip to content

Commit

Permalink
Merge branch 'feature/adjust-120'
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 committed Dec 3, 2019
2 parents 07970ff + 651fbb8 commit 105df26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ You can see options by `license-plist --help`.
- Default: false
- Only when the files are created or updated, the terminal or the finder opens. By adding `--suppress-opening-directory` flag, this behavior is suppressed.

#### `--export-all-to-root`
#### `--single-page`

- Default: false
- All licenses are displayed in one page, not a list.
- All licenses are listed on a single page, not separated pages.

### Integrate into build

Expand Down
4 changes: 2 additions & 2 deletions Sources/LicensePlist/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ let main = command(Option("cartfile-path", default: Consts.cartfileName),
Flag("force"),
Flag("add-version-numbers"),
Flag("suppress-opening-directory"),
Flag("export-all-to-root")) { cartfile, podsPath, packagePath, xcodeprojPath, output, gitHubToken, configPath, prefix, htmlPath, markdownPath, force, version, suppressOpen, exportAllToRoot in
Flag("single-page")) { cartfile, podsPath, packagePath, xcodeprojPath, output, gitHubToken, configPath, prefix, htmlPath, markdownPath, force, version, suppressOpen, singlePage in

Logger.configure()
var config = loadConfig(configPath: URL(fileURLWithPath: configPath))
config.force = force
config.addVersionNumbers = version
config.suppressOpeningDirectory = suppressOpen
config.exportAllToRoot = exportAllToRoot
config.singlePage = singlePage
let options = Options(outputPath: URL(fileURLWithPath: output),
cartfilePath: URL(fileURLWithPath: cartfile),
podsPath: URL(fileURLWithPath: podsPath),
Expand Down
2 changes: 1 addition & 1 deletion Sources/LicensePlistCore/Entity/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct Config {
public var force = false
public var addVersionNumbers = false
public var suppressOpeningDirectory = false
public var exportAllToRoot = false
public var singlePage = false

public static let empty = Config(githubs: [], manuals: [], excludes: [], renames: [:])

Expand Down
2 changes: 1 addition & 1 deletion Sources/LicensePlistCore/Entity/PlistInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct PlistInfo {
itemsPath.lp.createDirectory()
Log.info("Directory created: \(outputPath)")

let holder = options.config.exportAllToRoot ?
let holder = options.config.singlePage ?
LicensePlistHolder.loadAllToRoot(licenses: licenses) :
LicensePlistHolder.load(licenses: licenses, options: options)
holder.write(to: outputPath.appendingPathComponent("\(options.prefix).plist"), itemsPath: itemsPath)
Expand Down

0 comments on commit 105df26

Please sign in to comment.