Skip to content

Commit

Permalink
Added makefile, updated message printing
Browse files Browse the repository at this point in the history
  • Loading branch information
amichnia committed May 25, 2019
1 parent 1b28484 commit c37f909
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
EXECUTABLE_NAME = swiftymocky
REPO = https://github.com/MakeAWishFoundation/SwiftyMocky
VERSION = 3.3.0

PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME)
BUILD_PATH = .build/release/$(EXECUTABLE_NAME)
CURRENT_PATH = $(PWD)
RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz

.PHONY: install build uninstall clean

install: build
mkdir -p $(PREFIX)/bin
cp -f $(BUILD_PATH) $(INSTALL_PATH)

build:
swift build --disable-sandbox -c release

uninstall:
rm -f $(INSTALL_PATH)

clean:
rm -rf .build
2 changes: 1 addition & 1 deletion Sources/SwiftyMockyCLI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SwiftyMockyCLICore

let application = Application()

Message.swiftyMockyLabel("v\(application.version)")
Message.swiftyMockyLabel("SwiftyMocky CLI v\(application.version)")

Group() { main in

Expand Down
9 changes: 5 additions & 4 deletions Sources/SwiftyMockyCLICore/Utils/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ public enum Message {

// MARK: - Misc

public static func swiftyMockyLabel(_ ver: String) {
print(crayon.bold.on("╔═════════════════════════════╗"))
print(crayon.bold.on("║ SwiftyMocky CLI \(ver) BETA ║"))
print(crayon.bold.on("╚═════════════════════════════╝"))
public static func swiftyMockyLabel(_ message: String) {
let bar = String(repeating: "", count: message.count + 2)
print(crayon.bold.on("\(bar)"))
print(crayon.bold.on("\(message)"))
print(crayon.bold.on("\(bar)"))
print("")
}
}

0 comments on commit c37f909

Please sign in to comment.