diff --git a/app/Appwrite/Services/client.php b/app/Appwrite/Services/client.php index 0c2d981..871a5e2 100644 --- a/app/Appwrite/Services/client.php +++ b/app/Appwrite/Services/client.php @@ -69,7 +69,7 @@ $cli ->task('version') ->action(function() { - Console::log('CLI Version : 0.4.0'); + Console::log('CLI Version : 0.5.0'); Console::log('Server Version : 0.7.0'); }); diff --git a/app/Appwrite/Services/functions.php b/app/Appwrite/Services/functions.php index d0f570c..76cf6ec 100644 --- a/app/Appwrite/Services/functions.php +++ b/app/Appwrite/Services/functions.php @@ -385,14 +385,14 @@ $cloudFunctionPath = realpath(__DIR__.'/../../../files/'.$code); $cloudFunctionParentDir = dirname($cloudFunctionPath, 1); - $cloudFunctionDirName = basename($code); + $cloudFunctionDirName = basename($cloudFunctionPath); if (file_exists($cloudFunctionPath) === false ) { throw new Exception("Path doesn't exist. Please ensure that the path is within the current directory. "); } $archiveName = 'code.tar.gz'; $volumeMountPoint = realpath(__DIR__.'/../../../files/'); - exec("tar -zcvf $archiveName --exclude=$archiveName -C ${cloudFunctionParentDir} $cloudFunctionDirName && mv ${archiveName} ${volumeMountPoint}"); - $archivePath = realpath($volumeMountPoint."/$archiveName");$archivePath = realpath($volumeMountPoint."/$archiveName"); + exec("tar -zcvf $archiveName -C $cloudFunctionParentDir $cloudFunctionDirName && mv $archiveName $volumeMountPoint"); + $archivePath = realpath($volumeMountPoint."/$archiveName"); $cFile = new \CURLFile($archivePath, 'application/x-gzip' , basename($archivePath)); $params['code'] = $cFile; diff --git a/app/Appwrite/Services/help.php b/app/Appwrite/Services/help.php index 81d2e52..584e1f3 100644 --- a/app/Appwrite/Services/help.php +++ b/app/Appwrite/Services/help.php @@ -18,8 +18,8 @@ printf($mask, "avatars", "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars."); printf($mask, "database", "The Database service allows you to create structured collections of documents, query and filter lists of documents"); printf($mask, "functions", "The Functions Service allows you view, create and manage your Cloud Functions."); -printf($mask, "health", "The Health service allows you to both validate and monitor your Appwrite server's health."); -printf($mask, "locale", "The Locale service allows you to customize your app based on your users' location."); +printf($mask, "health", "The Health service allows you to both validate and monitor your Appwrite server's health."); +printf($mask, "locale", "The Locale service allows you to customize your app based on your users' location."); printf($mask, "storage", "The Storage service allows you to manage your project files."); printf($mask, "teams", "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources"); printf($mask, "users", "The Users service allows you to manage your project users."); diff --git a/bin/avatars b/bin/avatars index e302716..fe20635 100644 --- a/bin/avatars +++ b/bin/avatars @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/avatars.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/avatars.php help +else + php /usr/local/code/app/Appwrite/Services/avatars.php $@ +fi \ No newline at end of file diff --git a/bin/database b/bin/database index d3956c0..ca40989 100644 --- a/bin/database +++ b/bin/database @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/database.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/database.php help +else + php /usr/local/code/app/Appwrite/Services/database.php $@ +fi \ No newline at end of file diff --git a/bin/functions b/bin/functions index 79cfd3e..bb57ade 100644 --- a/bin/functions +++ b/bin/functions @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/functions.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/functions.php help +else + php /usr/local/code/app/Appwrite/Services/functions.php $@ +fi \ No newline at end of file diff --git a/bin/health b/bin/health index 864d864..f2464d8 100644 --- a/bin/health +++ b/bin/health @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/health.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/health.php help +else + php /usr/local/code/app/Appwrite/Services/health.php $@ +fi \ No newline at end of file diff --git a/bin/locale b/bin/locale index 2815619..9b50c5d 100644 --- a/bin/locale +++ b/bin/locale @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/locale.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/locale.php help +else + php /usr/local/code/app/Appwrite/Services/locale.php $@ +fi \ No newline at end of file diff --git a/bin/storage b/bin/storage index 6260249..7209937 100644 --- a/bin/storage +++ b/bin/storage @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/storage.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/storage.php help +else + php /usr/local/code/app/Appwrite/Services/storage.php $@ +fi \ No newline at end of file diff --git a/bin/teams b/bin/teams index 0ce6cba..db397ff 100644 --- a/bin/teams +++ b/bin/teams @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/teams.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/teams.php help +else + php /usr/local/code/app/Appwrite/Services/teams.php $@ +fi \ No newline at end of file diff --git a/bin/users b/bin/users index 44b4eaa..05e1ca4 100644 --- a/bin/users +++ b/bin/users @@ -1,3 +1,7 @@ #!/bin/sh -php /usr/local/code/app/Appwrite/Services/users.php $@ \ No newline at end of file +if [[ -z "$@" ]]; then + php /usr/local/code/app/Appwrite/Services/users.php help +else + php /usr/local/code/app/Appwrite/Services/users.php $@ +fi \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index 589382f..2bd3ffb 100644 --- a/src/Client.php +++ b/src/Client.php @@ -34,7 +34,7 @@ class Client */ private $headers = [ 'content-type' => '', - 'x-sdk-version' => 'appwrite:cli:0.4.0', + 'x-sdk-version' => 'appwrite:cli:0.5.0', ]; /**