Wget inside override-pull

I have a few parts that look like this, with a wget inside the override-pull

  kubectl:
    plugin: dump
    source: .
    override-pull: |
      wget -O kubectl https://storage.googleapis.com/kubernetes-release/release/v1.16.9/bin/linux/amd64/kubectl
      chmod +x kubectl

Is there a clever way to avoid running wget if the file is already there? Or should I just write a wrapper like if [ ! -f kubectl ] around each one?

Try -nc:

wget -nc -O kubectl https://storage.googleapis.com/kubernetes-release/release/v1.16.9/bin/linux/amd64/kubectl

Of course -nc will not avoid launching wget, but it can avoid downloading files again, under certain conditions which are explained in detail in the -nc documentation.

sweet. thank you! It looks like -nc will be work nicely