From bfec2012a8b030a6c661147e50483dd44372b6d8 Mon Sep 17 00:00:00 2001
From: Seyed Pouria Mousavizadeh Tehrani
Date: Fri, 2 Aug 2024 18:14:29 +0330
Subject: [PATCH] Make & Doc: Add make install
---
Makefile | 19 +++++++++++++++++--
README.md | 15 +++++++++++++++
ssh-import-id | Bin 0 -> 23488 bytes
3 files changed, 32 insertions(+), 2 deletions(-)
create mode 100755 ssh-import-id
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 0000000000000000000000000000000000000000..6551de0aac6cd83a951e8354b4e1afdd3ddf6da9
GIT binary patch
literal 23488
zcmeHPeRxz?nLi1nP=qF_Kq<8L(n1Rh84^A!&{7g$;8GJBfvj~c4wIRiWMncEXYK&$
zBNUpT9ft^Nt32Cksp1yb)}^|x6m1EXHmTN1ZFTXf)l|zm*`iHTwW)49`+LvF&7DK;
z=(_%ylV|3=@9+IM?|IM1y}9?!xx-((wz#N>sWOJ$#E3H{3#3{JHmd{1s@YOD3Ex+-
z_pplqkHx22igkLnSO^pyFZITNlHD{q7=d0PV5X>wkSN)CmEKE)L{U~Ic(N;@L&@v(
zk#eD@sFFMNRSG%N=vLVvMcsCko8vbMyW_R_^j6vKnN*CGnO1oZZrzn&8R8-}Y
zazdY_(w|PXu$gYxBJFg#20p1MN_9}#bj}X{E%nt)yW18DKRUfpcC@0ZzW2k9^77Xf
z)y*4aeO~=w%62O%t7i+Mk;dy6FNlUKqLEl?XT{E?*H>J>*q4m^MBo&cfe($TbsHL}
zJGu!|-C4Xx@X8;_XiAZs^mmNk`Hc0*Yqy*ILp>)i?oW@M`jNGyLvfQ0=};kk)#Zwx
zg#*&z`Ixj9%oSq@yAGc@^tp2X6=$qxTi^AIH!oc_n7QH`UwZS>MW^4q6e7>k4u>Nt
zO!dGYfv1u58$IxY9)9{f^tXB7>pc8C=z)LF!_U(m_$m)Szw^-F=AnP32mUz^{8JwO
z-|M0ONe{fi17GXm{|*oQeh>UN9ykrik;cO~5BydSKMOtdZ}Y$bGXo#JZ1B*(5{ibd
z41T@`e!#;ItxqGhcOLL^Hk}#uq7t>vJ_q({0p)#{N_|u6(;7e}Eb*STbFeXLu|S}?H69Bj?O?(V1cd5{ilI~@8nA-N
z_CP3V1!Ji;HjE_ggq29d69Q_E#v6mt5!52Fi0!tr?0B0SXtNSc@kDE$7j6UpNvn;4
z#6m$EF^6^r15J@wFdDhtA~@8NV6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