This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -Eeo pipefail | |
# check to see if this file is being run or sourced from another script | |
_is_sourced() { | |
# https://unix.stackexchange.com/a/215279 | |
[ "${#FUNCNAME[@]}" -ge 2 ] \ | |
&& [ "${FUNCNAME[0]}" = '_is_sourced' ] \ | |
&& [ "${FUNCNAME[1]}" = 'source' ] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeo pipefail | |
# check to see if this file is being run or sourced from another script | |
_is_sourced() { | |
# https://unix.stackexchange.com/a/215279 | |
[ "${#FUNCNAME[@]}" -ge 2 ] \ | |
&& [ "${FUNCNAME[0]}" = '_is_sourced' ] \ | |
&& [ "${FUNCNAME[1]}" = 'source' ] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eo pipefail | |
echo "DOMAIN=${DOMAIN}"; | |
if [[ "$ENV" == "development" ]]; then | |
if [[ ! -d /ssl/certs ]]; then | |
echo "Creating /ssl/certs" | |
mkdir -p /ssl/certs | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Path<T> = | |
T extends Array<infer S> ? Path<S> & string : | |
(T extends object ? { | |
[K in keyof T]: T[K] extends Array<any> ? Path.Item<T, K> : K & string | Path.Item<T, K> | |
}[keyof T] : never) | |
export namespace Path { | |
export type Item<T, K extends keyof T> = `${K & string}.${Path<T[K]> & string}` | |
export type Type<T, Q extends Path<T>> = | |
T extends Array<infer S> ? (Q extends Path<S> ? Type<S, Q> : never) : |