Skip to content

feat(clone): add --yes so the bash path can run unattended like the PowerShell one - #375

Open
jlinenkohl wants to merge 1 commit into
microsoft:mainfrom
jlinenkohl:fix-clone-noninteractive
Open

jlinenkohl wants to merge 1 commit into
microsoft:mainfrom
jlinenkohl:fix-clone-noninteractive

Conversation

@jlinenkohl

Copy link
Copy Markdown

Clone-Agent.ps1 takes -Force. clone-agent.sh has no equivalent, so the only way to drive it unattended is to pipe something into stdin -- and that stdin is inherited by every child process it spawns.

Both available workarounds fail. Piping a single line leaves the later read at EOF, which set -e turns into a silent exit before deployment. Piping an endless stream, yes | ./clone-agent.sh ..., makes az rest hang indefinitely: the same call returns in two seconds with stdin on /dev/null and never returns when stdin is an endless stream. Two export runs stalled for over two hours on a single GET that normally takes two seconds, with no output and no error.

That is easy to mistake for the bash path simply being slow, which it is not -- the PowerShell path completed the same export unattended because -Force meant nothing had to be piped at it.

-y / --yes / --force skips the prompt directly, so stdin can stay closed.

…owerShell one

Clone-Agent.ps1 takes -Force. clone-agent.sh has no equivalent, so the only way
to drive it unattended is to pipe something into stdin -- and that stdin is
inherited by every child process it spawns.

Both available workarounds fail. Piping a single line leaves the later `read`
at EOF, which `set -e` turns into a silent exit before deployment. Piping an
endless stream, `yes | ./clone-agent.sh ...`, makes `az rest` hang
indefinitely: the same call returns in two seconds with stdin on /dev/null and
never returns when stdin is an endless stream. Two export runs stalled for over
two hours on a single GET that normally takes two seconds, with no output and
no error.

That is easy to mistake for the bash path simply being slow, which it is not --
the PowerShell path completed the same export unattended because -Force meant
nothing had to be piped at it.

-y / --yes / --force skips the prompt directly, so stdin can stay closed.
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 this pull request may close these issues.

1 participant