Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion git-ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ def main():
raise FtpSslNotSupported("Python is too old for FTP SSL. Try using Python 2.7 or later.")
else:
ftp = ftplib.FTP(options.ftp.hostname, options.ftp.username, options.ftp.password)
ftp.cwd(base)

# Make the base directory an absolute path - it is required for the subsequent steps
if base[0] != '/':
base = os.path.join(ftp.pwd(), base)

try:
ftp.cwd(base)
except ftplib.error_perm:
raise ValueError("FTP base directory '%s' does not exist on this server (note: the server session starts at '%s')" % (base, ftp.pwd()))

# Check revision
hash = options.revision
Expand Down