Expect Example
The snippet can be accessed without any authentication.
Authored by
Chris Coley
expect-clone-repo.sh 374 B
expect -c " \
set timeout -1; \
spawn git clone https://git.codingallnight.com/chris/dotfiles.git ~/dotfiles; \
expect \\\"Username for 'https://git.codingallnight.com': \\\"; \
send -- \\\"#{vc['git']['username']}\\r\\\"; \
expect \\\"Password for 'https://#{vc['git']['username']}@git.codingallnight.com': \\\"; \
send -- \\\"#{vc['git']['password']}\\r\\\"; \
expect eof"
Please register or sign in to comment