kcl-lang.io/kpm@v0.8.7-0.20240520061008-9fc4c5efc8c7/scripts/pull_pkg.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Check kpm version
     4  version=$(./bin/kpm --version)
     5  if ! echo "$version" | grep -q "kpm version test_version"; then
     6    echo "Incorrect version: '$version'."
     7    exit 1
     8  fi
     9  
    10  # set the kpm default registry and repository
    11  export KPM_REG="ghcr.io"
    12  export KPM_REPO="kcl-lang"
    13  export OCI_REG_PLAIN_HTTP=off
    14  
    15  current_dir=$(pwd)
    16  
    17  mkdir -p ./scripts/pkg_in_reg/
    18  
    19  cd ./scripts/pkg_in_reg/
    20  
    21  
    22  # Check if file exists
    23  if [ ! -d "./ghcr.io/kcl-lang/k8s/1.14" ]; then
    24    $current_dir/bin/kpm pull k8s:1.14
    25  fi
    26  
    27  if [ ! -d "./ghcr.io/kcl-lang/k8s/1.27" ]; then
    28    $current_dir/bin/kpm pull k8s:1.27
    29  fi
    30  
    31  if [ ! -d "./ghcr.io/kcl-lang/helloworld/0.1.1" ]; then
    32    $current_dir/bin/kpm pull helloworld:0.1.1
    33  fi
    34  
    35  cd "$current_dir"