Commit c3756c8e authored by Ben Cooksley's avatar Ben Cooksley

Final runtime tweaks

parent 96f330d5
......@@ -26,7 +26,7 @@ if not CommonUtils.sftpFileExists( sftp, arguments.destination ):
sys.exit(1)
# Step 2: Start recursing through our local copy and uploading files
for root, files, directories in os.walk( arguments.source ):
for root, directories, files in os.walk( arguments.source ):
# First we need to make our root relative
relativeRoot = os.path.relpath( root, arguments.source )
# Now we can determine our remote prefix for this iteration
......@@ -35,7 +35,9 @@ for root, files, directories in os.walk( arguments.source ):
# First we check the directories to see if any need to be created
for directory in directories:
# Determine what it's full remote path would be
# Because SFTP works with forward not backslashes we have to translate those before use
remoteDirectory = os.path.join( remotePrefix, directory )
remoteDirectory = remoteDirectory.replace('\\', '/')
# Now check to see if it exists..
if not CommonUtils.sftpFileExists( sftp, remoteDirectory ):
# And create it if it doesn't exist...
......@@ -44,8 +46,10 @@ for root, files, directories in os.walk( arguments.source ):
# Now we can handle files!
for filename in files:
# Determine what it's full local and remote paths are
# Because SFTP works with forward not backslashes we have to translate those before use
localPath = os.path.join( root, filename )
remotePath = os.path.join( remotePrefix, filename )
remotePath = remotePath.replace('\\', '/')
# Prepare to begin checking whether we need to upload a file
# By default we don't need to upload
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment