diff --git a/Makefile b/Makefile index 0c03381..d9055a5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,23 @@ -all: +OS= $$(uname -o) + +.PHONY: depends +depends: + @echo "Install Dependencies" + @if [ -e /etc/debian_version ]; then\ + dpkg -s libcurl4-openssl-dev &>/dev/null || DEBIAN_FRONTEND=noninteractive apt install -y libcurl4-openssl-dev;\ + fi + +build: depends cc ssh-import-id.c -L/usr/local/lib -lcurl -I/usr/local/include -Wall -Wextra -Werror -o ssh-import-id +install: build + cp ssh-import-id /usr/local/bin/ + debug: cc -g ssh-import-id.c -L/usr/local/lib -lcurl -I/usr/local/include -Wall -Wextra -Werror -o ssh-import-id clean: - rm ssh-import-id ssh-import-id-gh ssh-import-id-lp + rm -f ssh-import-id ssh-import-id-gh ssh-import-id-lp + +uninstall: clean + rm /usr/local/bin/ssh-import-id diff --git a/README.md b/README.md index 264b77e..f8c19e1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,25 @@ # ssh-import-id + ssh-import-id written in C language +## Installation + +### GitHub + +To get started with the project, follow these steps: + +```sh +git clone https://github.com/spmzt/ssh-import-id.git +cd ssh-import-id +make install +``` + ## Contributions Any PR(s) are welcomed. ## TODO + - ~~add -u flag for useragent~~ - ~~add launchpad provider~~ - ~~add -t flag for truncate (overwrite current keys)~~ @@ -15,4 +29,5 @@ Any PR(s) are welcomed. - add capability to understand x_ratelimit_remaining header for github ## Known Issues + - Currently, User-Agent option is only supported 16 characters which is too short for most real User-Agents. diff --git a/ssh-import-id b/ssh-import-id new file mode 100755 index 0000000..6551de0 Binary files /dev/null and b/ssh-import-id differ