#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the RediStack open source project ## ## Copyright (c) 2023 RediStack project authors ## Licensed under Apache License v2.0 ## ## See LICENSE.txt for license information ## See CONTRIBUTORS.txt for the list of RediStack project authors ## ## SPDX-License-Identifier: Apache-2.0 ## ##===----------------------------------------------------------------------===## set -eu here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function genWithContextParameter() { how_many=$1 if [[ $how_many -ne 1 ]] ; then echo "" fi echo " @inlinable" echo -n " mutating func encodeRESPArray(_ t0: T0" for ((n = 1; n&2 "ERROR: ${BASH_SOURCE[0]}: file or directory not found (this should be this script)" exit 1 } { cat <<"EOF" //===----------------------------------------------------------------------===// // // This source file is part of the RediStack open source project // // Copyright (c) 2023 Apple Inc. and the RediStack project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information // See CONTRIBUTORS.txt for the list of RediStack project authors // // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// // // NOTE: THIS FILE IS AUTO-GENERATED BY scripts/generate_rediscommandencoder_multi_encode.sh EOF echo echo "#if swift(<5.9)" echo "extension RedisCommandEncoder {" # note: # - widening the inverval below (eg. going from {1..15} to {1..25}) is Semver minor # - narrowing the interval below is SemVer _MAJOR_! for n in {1..7}; do genWithContextParameter "$n" done echo "}" echo "#endif" } > "$here/../Sources/RediStack/RedisCommandEncoder-multi-encode.swift"