mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Add options to createRemoteDir
This commit is contained in:
parent
8625ec250b
commit
58aaad3fed
1 changed files with 12 additions and 3 deletions
|
@ -172,18 +172,27 @@ sub initLocalDir
|
||||||
mkdir ($localDir, 0777 );
|
mkdir ($localDir, 0777 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub createRemoteDir(;$)
|
sub createRemoteDir(;$$)
|
||||||
{
|
{
|
||||||
my ($dir) = @_;
|
my ($dir, $optionsRef) = @_;
|
||||||
|
|
||||||
my $url = testDirUrl() . $dir;
|
my $url = testDirUrl() . $dir;
|
||||||
|
|
||||||
|
if( $optionsRef && $optionsRef->{user} && $optionsRef->{passwd} ) {
|
||||||
|
$d->credentials( -url=> $owncloud, -realm=>"ownCloud",
|
||||||
|
-user=> $optionsRef->{user},
|
||||||
|
-pass=> $optionsRef->{passwd} );
|
||||||
|
if( $optionsRef->{url} ) {
|
||||||
|
$url = $optionsRef->{url} . $dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$d->open( $owncloud );
|
$d->open( $owncloud );
|
||||||
print $d->message . "\n";
|
print $d->message . "\n";
|
||||||
|
|
||||||
my $re = $d->mkcol( $url );
|
my $re = $d->mkcol( $url );
|
||||||
if( $re == 0 ) {
|
if( $re == 0 ) {
|
||||||
print "Failed to create directory <$url>: $re\n";
|
print "Failed to create directory <$url>: $d->message() \n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
$d->open( $url );
|
$d->open( $url );
|
||||||
|
|
Loading…
Reference in a new issue