Skip to content

Commit

Permalink
Fix function packaging on current dir
Browse files Browse the repository at this point in the history
  • Loading branch information
eldadfux committed Feb 18, 2021
1 parent 3c85d88 commit 255b06d
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/Appwrite/Services/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
6 changes: 3 additions & 3 deletions app/Appwrite/Services/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions app/Appwrite/Services/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
6 changes: 5 additions & 1 deletion bin/avatars
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/avatars.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/avatars.php help
else
php /usr/local/code/app/Appwrite/Services/avatars.php $@
fi
6 changes: 5 additions & 1 deletion bin/database
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/database.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/database.php help
else
php /usr/local/code/app/Appwrite/Services/database.php $@
fi
6 changes: 5 additions & 1 deletion bin/functions
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/functions.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/functions.php help
else
php /usr/local/code/app/Appwrite/Services/functions.php $@
fi
6 changes: 5 additions & 1 deletion bin/health
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/health.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/health.php help
else
php /usr/local/code/app/Appwrite/Services/health.php $@
fi
6 changes: 5 additions & 1 deletion bin/locale
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/locale.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/locale.php help
else
php /usr/local/code/app/Appwrite/Services/locale.php $@
fi
6 changes: 5 additions & 1 deletion bin/storage
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/storage.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/storage.php help
else
php /usr/local/code/app/Appwrite/Services/storage.php $@
fi
6 changes: 5 additions & 1 deletion bin/teams
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/teams.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/teams.php help
else
php /usr/local/code/app/Appwrite/Services/teams.php $@
fi
6 changes: 5 additions & 1 deletion bin/users
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

php /usr/local/code/app/Appwrite/Services/users.php $@
if [[ -z "$@" ]]; then
php /usr/local/code/app/Appwrite/Services/users.php help
else
php /usr/local/code/app/Appwrite/Services/users.php $@
fi
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

/**
Expand Down

0 comments on commit 255b06d

Please sign in to comment.