[script][android] Add flash_all cmd + completion
This commit is contained in:
parent
cdf21d7d10
commit
2c78121c1e
@ -206,3 +206,11 @@ _sdocker () {
|
||||
}
|
||||
|
||||
complete -o default -F _sdocker sdocker
|
||||
|
||||
_flash_all () {
|
||||
local cur
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
COMPREPLY=( $(compgen -W "$(ls *.img)" -- ${cur} ) )
|
||||
}
|
||||
|
||||
complete -o default -F _flash_all flash_all
|
||||
|
17
scripts/flash_all
Executable file
17
scripts/flash_all
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
if [ $# -eq 0 ];
|
||||
then
|
||||
imgList=$(ls *.img)
|
||||
echo "Flashing all images $imgList"
|
||||
else
|
||||
imgList=$@
|
||||
echo "Flashing $imgList"
|
||||
fi
|
||||
|
||||
if [ -z "$imgList" ];
|
||||
then
|
||||
echo "No img to Flash"
|
||||
exit 1
|
||||
else
|
||||
adb reboot bootloader; for img in $imgList; do fastboot flash ${img%.img} $img; done && fastboot reboot
|
||||
fi
|
Loading…
Reference in New Issue
Block a user