getting single variable value through CLI
I've used
with grep.
But is there a command to get a single variables value. Something like:
42 Replies
Project ID:
N/A
N/A
you could print as json and use jq? but what's your usecase?
i wish to run a script similar to this:
you can just run
after linking to the project with
railway link
and selecting the service with railway service
ok, didnt know about this.
i think i dont completely understand how railway CLI works š
ask away
how do i get $DATABASE_URL set ?
railway run
runs the given command with the variables from the linked service set
from your screenshot it looks like you need to link a servicemissed something
please read my messages a bit more carefully, you are missing the
railway run
partSolution
i manage to do it with ``
does it make sense?
yep you can do that with the shell too
ok, i'll try that aproach. thx!
remember, there's always this method I mentioned
i couldnt reproduce it with echo:
(the last line is a blank return)
windows? Linux?
macOS
worked for me (but im on windows)
so just stick with
railway shell
what shell is that @dwaynemac
zsh
interesting, so railway run echo $DATABASE_URL gives a blank return? what's the exit status?
i'll return in a minute
ā²ļø
š
looks like the
railway run
command could benefit from the same shell detection code as railway shell
any other questions? šfor the time being i resolved using railway shell
awsome!
sorry, how do i find this?
does that help?
should be able to just run
echo $?
after that commandafter railway shell? yes yes.
i'm just trying to answer @milo / salvage 's question:
about the exit status of the run command
after
railway run
run echo $?
and that should tell you the exit code of railway run
like milo asked forin the mean time i finished migrating another project from heroku to railway š„³
aaah, ok.
0
cool, thanks, milo said he'd look into this