Skip to content

Commit ec63ed4

Browse files
committed
save printer attributes in current dir only when using hostname
1 parent 4dbc70c commit ec63ed4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/de/gmuth/ipp/client/IppPrinter.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,9 @@ open class IppPrinter(
699699

700700
fun savePrinterAttributes() =
701701
exchange(ippRequest(GetPrinterAttributes)).run {
702-
printerDirectory = Path("")
703-
val name = if (attributes.containsKey("printer-make-and-model")) makeAndModel.text else printerUri.host
702+
703+
val name = if (attributes.containsKey("printer-make-and-model")) makeAndModel.text
704+
else printerUri.host.also { printerDirectory = Path("") }
704705
saveBytes(printerDirectory.resolve("$name.bin"))
705706
printerGroup.saveText(printerDirectory.resolve("$name.txt"))
706707
}

0 commit comments

Comments
 (0)