fi
done
}
+
+## Generate civicrm-version.php
+## usage: dm_generate_version <file> <ufname>
+function dm_generate_version() {
+ local to="$1"
+ local ufname="$2"
+
+ # final touch
+ echo "<?php
+function civicrmVersion( ) {
+ return array( 'version' => '$DM_VERSION',
+ 'cms' => '$ufname',
+ 'revision' => '$DM_REVISION' );
+}
+" > "$to"
+}
# copy docs
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
-
-# final touch
-echo "<?php
-function civicrmVersion( ) {
- return array( 'version' => '$DM_VERSION',
- 'cms' => 'Drupal6',
- 'revision' => '$DM_REVISION' );
-}
-" > $TRG/civicrm-version.php
+dm_generate_version "$TRG/civicrm-version.php" Drupal6
# gen tarball
cd $TRG/..
dm_install_drupal_info "$DM_SOURCEDIR/drupal"
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
-
-# final touch
-echo "<?php
-function civicrmVersion( ) {
- return array( 'version' => '$DM_VERSION',
- 'cms' => 'Drupal',
- 'revision' => '$DM_REVISION' );
-}
-" > $TRG/civicrm-version.php
+dm_generate_version "$TRG/civicrm-version.php" Drupal
# gen tarball
cd $TRG/..
-
tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-drupal.tar.gz civicrm
# clean up
# copy docs
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
-
-# final touch
-echo "<?php
-function civicrmVersion( ) {
- return array( 'version' => '$DM_VERSION',
- 'cms' => 'Drupal',
- 'revision' => '$DM_REVISION' );
-}
-" > $TRG/civicrm-version.php
+dm_generate_version "$TRG/civicrm-version.php" Drupal
# gen tarball
cd $TRG/..
# copy docs
cp $SRC/civicrm.config.php $TRG
-
-# final touch
-echo "<?php
-function civicrmVersion( ) {
- return array( 'version' => '$DM_VERSION',
- 'cms' => 'Joomla',
- 'revision' => '$DM_REVISION' );
-}
-" > $TRG/civicrm-version.php
+dm_generate_version "$TRG/civicrm-version.php" Joomla
# gen zip file
cd $DM_TMPDIR;
# copy docs
cp $SRC/WordPress/civicrm.config.php.wordpress $TRG/civicrm/civicrm/civicrm.config.php
-
-# final touch
-echo "<?php
-function civicrmVersion( ) {
- return array( 'version' => '$DM_VERSION',
- 'cms' => 'Wordpress',
- 'revision' => '$DM_REVISION' );
-}
-" > $TRG/civicrm/civicrm/civicrm-version.php
+dm_generate_version "$TRG/civicrm/civicrm/civicrm-version.php" Wordpress
# gen tarball
cd $TRG