Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-04-04 13:42:08 +0300
committerJoas Schilling <coding@schilljs.com>2019-04-08 18:00:54 +0300
commit074d5e306296d63c9163401cbd385b498b23fa8c (patch)
tree99e1308bc9c75fe6b62e52ff5577385825bbc749 /lib/Command
parent30cf5c289bf49eb33ac7b2dd8997fdc9d10a5cf4 (diff)
Add calculator example
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Command')
-rw-r--r--lib/Command/Command/AddSamples.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Command/Command/AddSamples.php b/lib/Command/Command/AddSamples.php
index bc7f43421..f1419f33f 100644
--- a/lib/Command/Command/AddSamples.php
+++ b/lib/Command/Command/AddSamples.php
@@ -76,6 +76,32 @@ class AddSamples extends Base {
}
try {
+ $this->service->find('', 'calculator');
+ } catch (DoesNotExistException $e) {
+ $commands[] = $this->service->create(
+ '',
+ 'calculator',
+ 'Calculator',
+ $appPath . '/sample-commands/calc.sh "{ARGUMENTS_DOUBLEQUOTE_ESCAPED}"',
+ Command::RESPONSE_USER,
+ Command::ENABLED_ALL
+ );
+ }
+
+ try {
+ $this->service->find('', 'calc');
+ } catch (DoesNotExistException $e) {
+ $commands[] = $this->service->create(
+ '',
+ 'calc',
+ 'Calculator',
+ 'alias:calculator',
+ Command::RESPONSE_ALL,
+ Command::ENABLED_ALL
+ );
+ }
+
+ try {
$this->service->find('', 'hackernews');
} catch (DoesNotExistException $e) {
$commands[] = $this->service->create(