github.com/vmware/govmomi@v0.37.1/simulator/guest_id.sh (about)

     1  #!/bin/bash -e
     2  
     3  pushd "$(dirname "$0")" >/dev/null
     4  
     5  {
     6    cat <<EOF
     7  /*
     8  Copyright (c) 2017 VMware, Inc. All Rights Reserved.
     9  
    10  Licensed under the Apache License, Version 2.0 (the "License");
    11  you may not use this file except in compliance with the License.
    12  You may obtain a copy of the License at
    13  
    14      http://www.apache.org/licenses/LICENSE-2.0
    15  
    16  Unless required by applicable law or agreed to in writing, software
    17  distributed under the License is distributed on an "AS IS" BASIS,
    18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    19  See the License for the specific language governing permissions and
    20  limitations under the License.
    21  */
    22  
    23  package simulator
    24  
    25  // GuestID is the list of valid types.VirtualMachineGuestOsIdentifier
    26  var GuestID = []types.VirtualMachineGuestOsIdentifier{
    27  EOF
    28  
    29    ids=($(grep 'VirtualMachineGuestOsIdentifier(' ../vim25/types/enum.go | grep = | awk '{print $1}'))
    30    printf "types.%s,\n" "${ids[@]}"
    31  
    32    echo "}"
    33  } > guest_id.go
    34  
    35  goimports -w guest_id.go