Skip to content

Add install and uninstall commands for make #293

@kiprasmel

Description

@kiprasmel

Currently, if I want to install the cli to the system (for example, to /usr/local/bin), I need to first run make and then manually copy the built executable into the desired location. The same scenario applies once uninstalling.

It'd be great if I could just run sudo make install to build + install the project, and obviously sudo make uninstall to uninstall it.

This would make it a little easier to package the project. For example, I'd like to add this to the Arch User Repository as github-cli-git.

Thanks & good luck with the development of the cli!


Edit:

From Makefile:

bin/gh: $(BUILD_FILES)
	@go build -ldflags "$(LDFLAGS)" -o "$@" ./cmd/gh

Would that supposedly solve my issue?
I tried both

sudo make /usr/local/bin/

and

sudo make bin/gh /usr/local/bin/

but neither worked - I just get

make: 'bin/gh' is up to date.
make: Nothing to be done for '/usr/local/bin/'.

Also, the uninstall step is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions