Skip to content

Commit 61a8c63

Browse files
committed
Update nimble
1 parent 92217bc commit 61a8c63

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

nmqtt.nimble

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,53 @@ author = "zevv"
44
description = "Native MQTT client library and binaries"
55
license = "MIT"
66
srcDir = "src"
7-
bin = @["nmqtt_pub", "nmqtt_sub", "nmqtt_broker"]
7+
bin = @["nmqtt", "nmqtt_password", "nmqtt_pub", "nmqtt_sub"]
8+
installFiles = @["nmqtt.nim"]
89

910

1011
# Dependencies
1112
requires "nim >= 1.0.6"
12-
requires "https://github.com/c-blake/cligen#36d5218"
13+
requires "bcrypt >= 0.2.1"
14+
requires "https://github.com/c-blake/cligen#36d5218"
15+
16+
from strutils import format
17+
18+
after install:
19+
var path: string
20+
21+
echo "\nGenerate default nmqtt.conf? (y/N)"
22+
let genConf = readLineFromStdin()
23+
if genConf == "y" or genConf == "Y":
24+
let confPath = "/home/" & getEnv("USER") & "/.config/nmqtt"
25+
echo "\nAbsolute path to nmqtt config folder. Default: " & confPath
26+
27+
path = readLineFromStdin()
28+
if path == "":
29+
path = confPath
30+
31+
if not dirExists(path):
32+
mkDir(path)
33+
34+
cpFile("config/nmqtt.conf", path & "/nmqtt.conf")
35+
echo "The brokers configuration has been saved at: " & path & "/nmqtt.conf"
36+
37+
echo """
38+
39+
nmqtt v$1 has been installed.
40+
41+
42+
LIBRARY:
43+
Access the nim-libary with an import statement in your code:
44+
45+
`import nmqtt`
46+
47+
48+
BINARIES:
49+
Access the binaries directly with. For help append `--help`.
50+
51+
nmqtt
52+
nmqtt_password
53+
nmqtt_pub
54+
nmqtt_sub
55+
56+
""".format(version)

0 commit comments

Comments
 (0)