Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get value of snake case variables #231

Closed
ybert opened this issue Oct 21, 2021 · 4 comments · Fixed by #235
Closed

Can't get value of snake case variables #231

ybert opened this issue Oct 21, 2021 · 4 comments · Fixed by #235

Comments

@ybert
Copy link

ybert commented Oct 21, 2021

  • Envoy Version: 2.7.0
  • Laravel Version: 8.61.0
  • PHP Version: 7.3

Description:

It seems that it is not possible to set snake case variables for envoy run deploy

Steps To Reproduce:

Envoy.blade.php :

@servers(['deployment' => '127.0.0.1'])

@setup
    if (empty($user)) {
        exit('ERROR: $user var empty or not defined');
    }
    if (empty($host)) {
        exit('ERROR: $host var empty or not defined');
    }
    if (empty($app_dir)) {
        exit('ERROR: $app_dir var empty or not defined');
    }
    if (empty($release_path)) {
        exit('ERROR: $release_path var empty or not defined');
    }
@endsetup

@task('deploy', ['on' => 'deployment'])
	exit ("deploy");
@endtask

When I run vendor/bin/envoy run deploy --user=www --host=staging.company.com --app_dir=/home/www/public
I get ERROR: $app_dir var empty or not defined

So it seems that it works perfectly with non snake case variables like --user or --host but not with --app_dir

@driesvints
Copy link
Member

This is indeed not supported.

@ybert
Copy link
Author

ybert commented Oct 21, 2021

@driesvints It was supported in previous version of Envoy (1.*)
It seems Hyphen case is not supported. So we have to name our variables like --appdir or --releasepath
Its not very readable.

@driesvints
Copy link
Member

If you can come up with a PR that implements this in a clean way we may consider it.

@finagin
Copy link
Contributor

finagin commented Oct 27, 2021

@ybert, use --app-dir to call in code $app_dir or $appDir

pgrenaud added a commit to eXolnet/envoy that referenced this issue Jul 19, 2023
Resolve laravel#231
Usage both of camel and snake case variables.

(cherry picked from commit 7d48051)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants