Skip to content

Commit

Permalink
fix Upload command bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
miiimooo committed Aug 24, 2020
1 parent 2c5cd00 commit 8b1595e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -12,7 +12,7 @@ After that you may run dropcat as: `vendor/bin/dropcat`
## Install globally (Mac/Linux)

For this forked version of dropcat
| `curl -L0 https://github.com/miiimooo/dropcat/releases/download/2.1.0/dropcat.phar -o /usr/local/bin/dropcat`
| `curl -L0 https://github.com/miiimooo/dropcat/releases/download/2.0.3/dropcat.phar -o /usr/local/bin/dropcat`
| `chmod +x /usr/local/bin/dropcat`
| `dropcat about`

Expand Down
8 changes: 4 additions & 4 deletions src/Dropcat/Command/UploadCommand.php
Expand Up @@ -195,7 +195,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
exit(1);
}

$tarExists = $sftp->file_exists("$tar_dir/$tarfile");
$tarExists = $sftp->file_exists("$targetdir/$tarfile");
// Setting default value

if ($output->isVerbose()) {
Expand All @@ -204,9 +204,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$remoteFileSha1 = null;
if ($tarExists) {
if ($checksha1 === true) {
$remoteFileSha1 = $sftp->exec("sha1sum $tar_dir/$tarfile | awk '{print $1}'");
$remoteFileSha1 = $sftp->exec("sha1sum $targetdir/$tarfile | awk '{print $1}'");
if ($output->isVerbose()) {
echo "tar is at $tar_dir/$tarfile\n";
echo "tar is at $targetdir/$tarfile\n";
echo "local file hash is $localFileSha1\n";
echo "remote file hash is $remoteFileSha1\n";
echo "SHA1 for file match\n";
Expand All @@ -222,7 +222,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
} else {
if ($output->isVerbose()) {
echo "tar is at $tar_dir/$tarfile\n";
echo "tar is at $targetdir/$tarfile\n";
echo "local file hash is $localFileSha1\n";
echo "remote file hash is $remoteFileSha1\n";
}
Expand Down

0 comments on commit 8b1595e

Please sign in to comment.