You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cloud tool's source code is a single file 2312 lines long, which is shameful, and makes it hard to read, navigate, and maintain.
Break it down into smaller modules (.sh include files). Put modules into the kcidb directory. Group functions and variables by prefix, and put them into correspondingly-named files. E.g. all functions and variables with prefix psql_/PSQL_ should go into a file named kcidb/psql.sh, and so on.
The original cloud file must add the directory it's located in in front of the PATH environment variable (following its syntax, i.e. using the : path separator), and then include the modules using the . (source) command. E.g. like this:
Each module file should start with a short description of its contents, and should have anti-recursive inclusion protection around its code and definitions. E.g. the kcidb/psql.sh file should have:
# PostgreSQL database deployment definitions and managementif [ -z"${_PSQL_SH+set}" ];thendeclare _PSQL_SH=
# Code and definitions go herefi# _PSQL_SH
Various definitions reused by multiple files, that are too few for a separate module, should go into kcidb/misc.sh, but don't have to have a misc_ prefix added to their names.
The text was updated successfully, but these errors were encountered:
The
cloud
tool's source code is a single file 2312 lines long, which is shameful, and makes it hard to read, navigate, and maintain.Break it down into smaller modules (
.sh
include files). Put modules into thekcidb
directory. Group functions and variables by prefix, and put them into correspondingly-named files. E.g. all functions and variables with prefixpsql_
/PSQL_
should go into a file namedkcidb/psql.sh
, and so on.The original
cloud
file must add the directory it's located in in front of thePATH
environment variable (following its syntax, i.e. using the:
path separator), and then include the modules using the.
(source
) command. E.g. like this:Each module file should start with a short description of its contents, and should have anti-recursive inclusion protection around its code and definitions. E.g. the
kcidb/psql.sh
file should have:Various definitions reused by multiple files, that are too few for a separate module, should go into
kcidb/misc.sh
, but don't have to have amisc_
prefix added to their names.The text was updated successfully, but these errors were encountered: