Skip to content

Commit

Permalink
support directory in client options (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasily-polonsky authored Apr 15, 2023
1 parent 3bb51b3 commit 717fb97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare module "samba-client" {
readonly password?: string;
readonly domain?: string;
readonly port?: number;
readonly directory?: string;
readonly timeout?: number;
readonly maxProtocol?: string;
readonly maskCmd?: boolean;
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SambaClient {
this.password = options.password;
this.domain = options.domain;
this.port = options.port;
this.directory = options.directory;
this.timeout = options.timeout;
// Possible values for protocol version are listed in the Samba man pages:
// https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#CLIENTMAXPROTOCOL
Expand Down Expand Up @@ -146,6 +147,10 @@ class SambaClient {
args.push("-W", this.domain);
}

if (this.directory) {
args.push("-D", this.directory);
}

if (this.maxProtocol) {
args.push("--max-protocol", this.maxProtocol);
}
Expand Down

0 comments on commit 717fb97

Please sign in to comment.