Skip to content

Commit cce81d7

Browse files
committed
Remove readLineStdin from Nimble install. Github actions and installation of other package is blocked by it. Use nimble setup nmqtt to generate the config.
1 parent 94b0cb8 commit cce81d7

3 files changed

Lines changed: 16 additions & 20 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ The package provides 4 MQTT binaries:
3737

3838

3939
## nmqtt
40+
41+
A default configuration file is provided in `config/nmqtt.conf`. You can copy and paste this file to a desired location, or run `nimble setup nmqtt` which will guide you through it.
42+
4043
```
4144
$ nmqtt --help
4245
nmqtt version 1.0.0

nmqtt.nimble

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Package
2-
version = "1.0.1"
2+
version = "1.0.2"
33
author = "zevv & ThomasTJdev"
44
description = "Native MQTT library and binaries for publishing, subscribing and broker"
55
license = "MIT"
@@ -21,14 +21,14 @@ task test, "Runs the test suite.":
2121
exec "nimble c -y -r tests/tester"
2222

2323

24-
after install:
24+
task setup, "Generate default nmqtt configuration file":
2525
var path: string
2626

2727
echo "\nGenerate default nmqtt.conf? (y/N)"
2828
let genConf = readLineFromStdin()
2929
if genConf == "y" or genConf == "Y":
3030
let confPath = "/home/" & getEnv("USER") & "/.nmqtt"
31-
echo "\nAbsolute path to nmqtt config folder. Default: " & confPath
31+
echo "\nSpecify the absolute path to the nmqtt config folder.\nPress enter to use default path: " & confPath
3232

3333
path = readLineFromStdin()
3434
if path == "":
@@ -38,25 +38,18 @@ after install:
3838
mkDir(path)
3939

4040
cpFile("config/nmqtt.conf", path & "/nmqtt.conf")
41-
echo "The brokers configuration has been saved at: " & path & "/nmqtt.conf"
4241

43-
echo """
42+
echo """
43+
___________________________________________________________
4444
45-
nmqtt v$1 has been installed.
45+
nmqtt v$1
4646
47+
The brokers configuration has been saved at:
48+
$2/nmqtt.conf
4749
48-
LIBRARY:
49-
Access the nim-libary with an import statement in your code:
50+
You can now run the broker with:
51+
nmqtt -c $2/nmqtt.conf
5052
51-
`import nmqtt`
53+
___________________________________________________________
5254
53-
54-
BINARIES:
55-
Access the binaries directly with the commands below. For help append `--help`.
56-
57-
nmqtt
58-
nmqtt_password
59-
nmqtt_pub
60-
nmqtt_sub
61-
62-
""".format(version)
55+
""".format(version, path)

tests/tester.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ when not defined(test):
66
echo "Please run with -d:test, exiting"
77
quit()
88

9-
include ../src/nmqtt
9+
include "../nmqtt.nim"
1010

1111
randomize()
1212

0 commit comments

Comments
 (0)