71 lines
2.1 KiB
Bash
71 lines
2.1 KiB
Bash
#!/bin/bash
|
|
|
|
current_date=$(date +'%B %Y')
|
|
|
|
# Check if JOOMLA_USER is set, otherwise prompt for it
|
|
if [ -z "$JOOMLA_USER" ]; then
|
|
read -p "Enter the Joomla user: " JOOMLA_USER
|
|
fi
|
|
|
|
# Check if EMAIL is set, otherwise prompt for it
|
|
if [ -z "$EMAIL" ]; then
|
|
read -p "Enter the email address: " EMAIL
|
|
fi
|
|
|
|
cat <<EOM > ${name}.xml
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<extension type="component" method="upgrade">
|
|
<name>com_${name}</name>
|
|
<!-- The following elements are optional and free of formatting conttraints -->
|
|
<creationDate>${current_date}</creationDate>
|
|
<author>${JOOMLA_USER}</author>
|
|
<authorEmail>${EMAIL}</authorEmail>
|
|
<authorUrl>https://www.example.com/</authorUrl>
|
|
<copyright>Copyright (C) 2023 ${JOOMLA_USER}, All rights reserved.</copyright>
|
|
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
|
|
<!-- The version string is recorded in the components table -->
|
|
<version>0.0.1</version>
|
|
<!-- The description is optional and defaults to the name -->
|
|
<description>COM_${name}_XML_DESCRIPTION</description>
|
|
<namespace path="src">J4xdemos\Component\${name#com_}</namespace>
|
|
|
|
<install> <!-- Runs on install -->
|
|
<sql>
|
|
<file driver="mysql" charset="utf8">sql/install.mysql.sql</file>
|
|
</sql>
|
|
</install>
|
|
<uninstall> <!-- Runs on uninstall -->
|
|
<sql>
|
|
<file driver="mysql" charset="utf8">sql/uninstall.mysql.sql</file>
|
|
</sql>
|
|
</uninstall>
|
|
|
|
<!-- Site Main File Copy Section -->
|
|
<!-- Note the folder attribute: This attribute describes the folder
|
|
to copy FROM in the package to install therefore files copied
|
|
in this section are copied from /site/ in the package -->
|
|
|
|
<files folder="site">
|
|
<folder>forms</folder>
|
|
<folder>language</folder>
|
|
<folder>src</folder>
|
|
<folder>tmpl</folder>
|
|
</files>
|
|
|
|
<administration>
|
|
<files folder="admin">
|
|
<file>access.xml</file>
|
|
<file>config.xml</file>
|
|
<folder>forms</folder>
|
|
<folder>language</folder>
|
|
<folder>services</folder>
|
|
<folder>sql</folder>
|
|
<folder>src</folder>
|
|
<folder>tmpl</folder>
|
|
</files>
|
|
<menu img="class:default" link="option=com_mywalks">com_mywalks</menu>
|
|
</administration>
|
|
</extension>
|
|
EOM
|
|
|
|
|