Skip to content

Commit

Permalink
Fixes the description for init
Browse files Browse the repository at this point in the history
  • Loading branch information
wess committed Nov 29, 2016
1 parent ebd3a6c commit 5fe02b6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.overlook
.DS_Store
/.build
/Tests
/Packages
/*.xcodeproj
6 changes: 3 additions & 3 deletions Sources/overlook/commands/init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
//
//

import Foundation
import SwiftCLI
import Foundation
import SwiftCLI
import PathKit
import Rainbow

public class InitCommand : Command {
public let name = "init"
public let signature = ""
public let shortDescription = "Prints the current version of Overlook"
public let shortDescription = "Creates a new .overlook file in the current directory."

public func execute(arguments: CommandArguments) throws {
let data = try JSONSerialization.data(withJSONObject: Overlook.dotTemplate, options: .prettyPrinted)
Expand Down
34 changes: 17 additions & 17 deletions Sources/overlook/overlook.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
//
//

import Foundation
import SwiftCLI
import PathKit
import Foundation
import SwiftCLI
import PathKit
import Rainbow
import config
import env

public class Overlook {
static let name = "overlook"
static let version = "0.1.0"
static let version = "0.1.1"
static let desc = "File monitoring tool that excutes on change. Used anywhere."

static let dotTemplate:[String:Any] = [
"env" : ["example" : "variable"],
"verbose" : true,
Expand All @@ -40,17 +40,17 @@ public class Overlook {
initCommand,
]
}

public init() {
CLI.setup(name: Overlook.name, version: Overlook.version, description: Overlook.desc)

setupRouter()
setupCommands()
setupAliases()
}
}

private func setupRouter() {
CLI.router = self.router
CLI.router = self.router
}

private func setupCommands() {
Expand All @@ -68,37 +68,37 @@ public class Overlook {
CLI.alias(from: "-v", to: "version")
CLI.alias(from: "--version", to: "version")


CLI.alias(from: "-i", to: "init")
CLI.alias(from: "--init", to: "init")

CLI.alias(from: "-w", to: "watch")
CLI.alias(from: "--watch", to: "watch")
}

public func run() {
public func run() {
let result = CLI.go()

guard result == CLIResult.success else {
exit(result)
}

guard self.router.exitImmediately == false else {
exit(result)
}

guard runOnce.contains(where: { $0 == self.router.current } ) else {
dispatchMain()
}

exit(result)
}
}

public func startup(_ run:String, watching:[String]) {
let executing = "executing: "
let target = run.bold

print("\nStarting Overlook...".green.bold)
print(executing + target.bold)
print("watching:")
Expand Down

0 comments on commit 5fe02b6

Please sign in to comment.