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
We should consider implementing a way for pcmd to retrieve the patsh to content directories form the shell.
Having this feature would allow users to run pcmd from anywhere anywhere without having to run it from the root of the repository.
It could also improve the pantheon2.yml file generation feature, allowing the generation script to locate the content directory and add its path relative to the repository root under the modules and assemblies section of the YAML template.
We can use built in shell commands and git tools to avoid introducing too many package dependencies.
For example, we can retrieve the absolute path to the repository root using:
REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
we can then get the root directory name using basename and use it to build relative paths to other content directories
(If we only need the name of the root directory, we can do this in one step.)
ROOT_DIR=$(basename ${REPOSITORY_ROOT})
Alternatively, we can have the script locate the content directories automatically.
This should be fairly easy to do, because we have standardized the content directory names to assemblies and modules across all repos so we can search for them by name
We could use something like:
ASSEMBLIES_DIR=$(find ${REPOSITORY_ROOT} -type d -name "modules")
Please not that these are just initial suggestions, we can tweak and changes them based on usability and tooling considerations.
The text was updated successfully, but these errors were encountered:
We should consider implementing a way for
pcmd
to retrieve the patsh to content directories form the shell.Having this feature would allow users to run
pcmd
from anywhere anywhere without having to run it from the root of the repository.It could also improve the
pantheon2.yml
file generation feature, allowing the generation script to locate the content directory and add its path relative to the repository root under themodules
andassemblies
section of the YAML template.We can use built in shell commands and git tools to avoid introducing too many package dependencies.
For example, we can retrieve the absolute path to the repository root using:
REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
we can then get the root directory name using
basename
and use it to build relative paths to other content directories(If we only need the name of the root directory, we can do this in one step.)
ROOT_DIR=$(basename ${REPOSITORY_ROOT})
Alternatively, we can have the script locate the content directories automatically.
This should be fairly easy to do, because we have standardized the content directory names to
assemblies
andmodules
across all repos so we can search for them by nameWe could use something like:
ASSEMBLIES_DIR=$(find ${REPOSITORY_ROOT} -type d -name "modules")
Please not that these are just initial suggestions, we can tweak and changes them based on usability and tooling considerations.
The text was updated successfully, but these errors were encountered: