Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Przybyl committed Nov 27, 2024
1 parent 0366c65 commit 977abed
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
3 changes: 2 additions & 1 deletion pkg/project/common/aemw
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ export MSYS2_ENV_CONV_EXCL="*"
# Execute AEM Compose CLI
# =======================

aem "$@"
AEM=$(whereis aem | awk '{print $2}')
${AEM} "$@"
81 changes: 41 additions & 40 deletions scripts/tools-install-idea.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Check if Taskfile.yaml exists
if [ ! -f "Taskfile.yaml" ]; then
echo "Taskfile.yaml not found in the current directory."
# Check if Taskfile.yml exists
if [ ! -f "Taskfile.yml" ]; then
echo "Taskfile.yml not found in the current directory."
exit 1
fi

# Define content to be appended to 'Taskfile.yaml'
TASKS_YAML_CONTENT=$(cat <<'EOF'
# Define content to be appended to 'Taskfile.yml'
TASKS_YML_CONTENT=$(cat <<'EOF'
groovy:execute:
desc: execute Groovy script on AEM instance
cmd: |
Expand Down Expand Up @@ -79,97 +80,97 @@ TASKS_YAML_CONTENT=$(cat <<'EOF'
EOF
)

# Define IDEA's 'tools/AEM.xml' content
AEM_XML_CONTENT=$(cat <<'EOF'
<toolSet name="AEM">
<tool name="Content Pull [author]" description="Content Pull [author]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
# Define IDEA's 'tools/AEMC.xml' content
AEMC_XML_CONTENT=$(cat <<'EOF'
<toolSet name="AEMC">
<tool name="Content Clean" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/aemw" />
<option name="PARAMETERS" value="content pull -A --path &quot;$FilePath$&quot; --clean" />
<option name="PARAMETERS" value="content clean --path $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="Content Pull [publish]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<tool name="Content Pull [author]" description="Content Pull [author]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/aemw" />
<option name="PARAMETERS" value="content pull -P --path &quot;$FilePath$&quot; --clean" />
<option name="PARAMETERS" value="content pull -A --path $FilePath$ --clean" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="Content Clean" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="false" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<tool name="Content Pull [publish]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/aemw" />
<option name="PARAMETERS" value="content clean --path &quot;$FilePath$&quot;" />
<option name="PARAMETERS" value="content pull -P --path $FilePath$ --clean" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="Groovy Console [author]" description="Run currently opened Groovy Script in editor on author instance" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<tool name="Content Push [author]" description="Content Push [author]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/taskw" />
<option name="PARAMETERS" value="groovy:execute -- author $FilePath$" />
<option name="COMMAND" value="$ProjectFileDir$/aemw" />
<option name="PARAMETERS" value="content push -A --path $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="Groovy Console [publish]" description="Run currently opened Groovy Script in editor on publish instance" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<tool name="Content Push [publish]" description="Content Push [publish]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/taskw" />
<option name="PARAMETERS" value="groovy:execute -- publish $FilePath$" />
<option name="COMMAND" value="$ProjectFileDir$/aemw" />
<option name="PARAMETERS" value="content push -P --path $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="Content Push [author]" description="Content Push [author]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<tool name="CRXDE Open [author]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/aemw" />
<option name="PARAMETERS" value="content push -A --path &quot;$FilePath$&quot;" />
<option name="COMMAND" value="$ProjectFileDir$/taskw" />
<option name="PARAMETERS" value="crxde:open -- author $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="Content Push [publish]" description="Content Push [publish]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<tool name="CRXDE Open [publish]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/aemw" />
<option name="PARAMETERS" value="content push -P --path &quot;$FilePath$&quot;" />
<option name="COMMAND" value="$ProjectFileDir$/taskw" />
<option name="PARAMETERS" value="crxde:open -- publish $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="CRXDE Open [author]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="false" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="false">
<tool name="Groovy Console [author]" description="Run currently opened Groovy Script in editor on author instance" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/taskw" />
<option name="PARAMETERS" value="crxde:open -- author $FilePath$" />
<option name="PARAMETERS" value="groovy:execute -- author $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="CRXDE Open [publish]" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="false" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="false">
<tool name="Groovy Console [publish]" description="Run currently opened Groovy Script in editor on publish instance" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/taskw" />
<option name="PARAMETERS" value="crxde:open -- publish $FilePath$" />
<option name="PARAMETERS" value="groovy:execute -- publish $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
</toolSet>
EOF
)

# Function to create 'tools/AEM.xml' in IntelliJ installations
create_aem_xml() {
# Function to create 'tools/AEMC.xml' in IntelliJ installations
create_aemc_xml() {
local intellij_dirs=(
"$HOME/Library/Application Support/JetBrains/IntelliJIdea"*/tools
)

for dir in "${intellij_dirs[@]}"; do
if [ -d "$dir" ]; then
local aem_file="$dir/AEM.xml"
echo "Creating AEM.xml in $aem_file"
echo "$AEM_XML_CONTENT" > "$aem_file"
local aem_file="$dir/AEMC.xml"
echo "Creating AEMC.xml in $aem_file"
echo "$AEMC_XML_CONTENT" > "$aem_file"
fi
done
}

# Create AEM.xml in IntelliJ installations
create_aem_xml
# Create AEMC.xml in IntelliJ installations
create_aemc_xml

# Append tasks.yaml content to Taskfile.yaml
echo "Appending tasks.yaml content to Taskfile.yaml"
echo "$TASKS_YAML_CONTENT" >> "Taskfile.yaml"
# Append tasks.yml content to Taskfile.yml
echo "Appending tasks.yml content to Taskfile.yml"
echo "$TASKS_YML_CONTENT" >> "Taskfile.yml"

echo "Script execution completed."
echo "Please restart IntelliJ IDEA to see the changes."

0 comments on commit 977abed

Please sign in to comment.