Skip to content

Commit

Permalink
fix windows SMB (#69)
Browse files Browse the repository at this point in the history
* fixed user with spaces

* cloud 2

* fix Cemu

* greemDev

* publish

* greemDev

* publish

* fix windows SMB

* fix button height

---------

Co-authored-by: Dragoon Dorise <[email protected]>
  • Loading branch information
nintendo424 and dragoonDorise authored Dec 10, 2024
1 parent 16a4aca commit 8ac0fdc
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions functions/ToolScripts/emuDeckSaveSync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ function Get-Custom-Credentials($provider){
$textBoxUrl.Size = New-Object System.Drawing.Size(150, 20)
$form.Controls.Add($textBoxUrl)

$labelShare = New-Object System.Windows.Forms.Label
$labelShare.Text = "Share name:"
$labelShare.Location = New-Object System.Drawing.Point(30, 150)
$form.Controls.Add($labelShare)
$textBoxShare = New-Object System.Windows.Forms.TextBox
$textBoxShare.Location = New-Object System.Drawing.Point(140, 150)
$textBoxShare.Size = New-Object System.Drawing.Size(150, 20)
$form.Controls.Add($textBoxShare)

#$labelPort = New-Object System.Windows.Forms.Label
#$labelPort.Text = "You need to create an emudeck folder in the root of your storage before #setting up CloudSync"
#$labelPort.Location = New-Object System.Drawing.Point(40, 200)
Expand All @@ -92,7 +101,9 @@ function Get-Custom-Credentials($provider){
}
if( $provider -eq "Emudeck-SFTP" ){
$buttonHeight=200
}else{
} elseif( $provider -eq "Emudeck-SMB" ) {
$buttonHeight=200
} else{
$buttonHeight=160
}

Expand All @@ -116,12 +127,14 @@ function Get-Custom-Credentials($provider){
if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
$username = $textBoxUsername.Text
$password = $textBoxPassword.Text
$share = $textBoxShare.Text
$url = $textBoxUrl.Text
$port = $textBoxPort.Text
#stopLog
return [PSCustomObject]@{
Username = $username
Password = $password
Share = $share
Url = $url
Port = $port
}
Expand Down Expand Up @@ -301,6 +314,7 @@ function cloud_sync_config($cloud_sync_provider, $token){
} elseif ($cloud_sync_provider -eq "Emudeck-SMB") {
$credentials = Get-Custom-Credentials "Emudeck-SMB"
$pass=$credentials.Password
$share=$credentials.Share
$params="obscure $pass"
$obscuredPassword = Invoke-Expression "$cloud_sync_bin $params"

Expand All @@ -312,8 +326,9 @@ function cloud_sync_config($cloud_sync_provider, $token){
createCloudFile $_.FullName
}

& $cloud_sync_bin mkdir "$cloud_sync_provider`:Emudeck\saves"
& $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:Emudeck\saves" --include "*.cloud"
$path="${cloud_sync_provider}:${share}\Emudeck\saves"
& $cloud_sync_bin mkdir $path
& $cloud_sync_bin copy $savesPath $path --include "*.cloud"
#Cleaning up
Get-ChildItem -Path $carpetaLocal -Filter "*.cloud" | ForEach-Object {
Remove-Item $_.FullName
Expand Down

0 comments on commit 8ac0fdc

Please sign in to comment.