-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ux): update CLI, README and Makefile to improve usability
- Make the installation process simple, and make subsequent crates easy to add here. - Explain why we still need to run the server using a shell script. - Simplify the client command line interface. We didn't need the extra layer of remove, we only have one command here.
- Loading branch information
Showing
5 changed files
with
101 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,45 @@ | ||
BIN_NAME = server | ||
BUILD_MODE = release | ||
BUILD_MODE:=release | ||
PACKAGE=server client | ||
BINARIES=$(addprefix target/$(BUILD_MODE)/, $(PACKAGE)) | ||
INSTALLED_BINARIES=$(addprefix $(INSTALL_DIR)/voice-, $(PACKAGE)) | ||
|
||
TARGET = $(BIN_NAME)_$(BUILD_MODE) | ||
all: $(BINARIES) | ||
|
||
BIN = target/$(BUILD_MODE)/$(BIN_NAME) | ||
.PHONY: require-bin | ||
require-bin: | ||
ifndef INSTALL_DIR | ||
$(error INSTALL_DIR is not set) | ||
endif | ||
|
||
all: $(TARGET) | ||
.PHONY: install | ||
install: require-bin $(INSTALLED_BINARIES) | ||
|
||
.PHONY: clean | ||
clean: | ||
clean: clean-bin | ||
cargo clean | ||
rm -f $(TARGET) | ||
|
||
$(TARGET): $(BIN) | ||
cp $(BIN) $(TARGET) | ||
|
||
$(BIN): | ||
cargo build --$(BUILD_MODE) -p $(BIN_NAME) | ||
|
||
DAEMON = local.personal.transcription | ||
|
||
kick: $(TARGET) | ||
.PHONY: clean-bin | ||
clean-bin: | ||
rm -f $(BINARIES) | ||
ifdef $(INSTALL_DIR) | ||
rm -f $(INSTALLED_BINARIES) | ||
endif | ||
|
||
$(INSTALL_DIR)/voice-%: target/$(BUILD_MODE)/% | ||
cp $< $@ | ||
|
||
ifeq ($(words $(PACKAGE)),1) | ||
target/$(BUILD_MODE)/%: | ||
else | ||
$(BINARIES): | ||
endif | ||
ifeq ($(BUILD_MODE),release) | ||
cargo build --$(BUILD_MODE) $(foreach p, $(PACKAGE),-p $p) | ||
else | ||
cargo build $(foreach p, $(PACKAGE),-p $p) | ||
endif | ||
|
||
DAEMON:=local.personal.transcription | ||
|
||
kick: require-bin $(INSTALL_DIR)/voice-server | ||
launchctl kickstart -k gui/$(shell id -u)/$(DAEMON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters