4 ## usage: dm_reset_dirs <path1> <path2> ...
5 function dm_reset_dirs
() {
7 [ -d "$d" ] && rm -rf "$d"
13 ## Copy files from one dir into another dir
14 ## usage: dm_install_dir <from-dir> <to-dir>
15 function dm_install_dir
() {
19 if [ ! -d "$to" ]; then
22 $DM_RSYNC -avC --exclude=.git
--exclude=.svn
"$from/./" "$to/./"
26 ## usage: dm_install_files <from-dir> <to-dir> <file1> <file2>...
27 function dm_install_files
() {
34 [ -f "$from/$file" ] && cp -f "$from/$file" "$to/$file"
38 ## usage: dm_remove_files <directory> <file1> <file2>...
39 function dm_remove_files
() {
44 [ -f "$tgt/$file" ] && rm -f "$tgt/$file"
48 ## Copy all core files
49 ## usage: dm_install_core <core_repo_path> <to_path>
50 function dm_install_core
() {
54 for dir
in css i js PEAR templates bin CRM api extern Reports
install settings Civi partials node_modules bower_components
; do
55 [ -d "$repo/$dir" ] && dm_install_dir
"$repo/$dir" "$to/$dir"
58 dm_install_files
"$repo" "$to" {agpl-3.0
,agpl-3.0.exception
,gpl
,README
,CONTRIBUTORS
}.txt
61 pushd "$repo" >> /dev
/null
62 dm_install_files
"$repo" "$to" sql
/civicrm
*.mysql
sql
/case_sample
*.mysql
63 ## TODO: for master, remove counties.US.SQL.gz
66 if [ -d $to/bin
] ; then
67 rm -f $to/bin
/setup.sh
68 rm -f $to/bin
/setup.php4.sh
69 rm -f $to/bin
/setup.bat
73 rm -rf $to/sql
/civicrm_
*.??_??.mysql
78 ## usage: dm_install_packages <packages_repo_path> <to_path>
79 function dm_install_packages
() {
83 local excludes_rsync
=""
84 for exclude
in .git .svn _ORIGINAL_ SeleniumRC PHPUnit PhpDocumentor SymfonyComponents amavisd-new git-footnote
; do
85 excludes_rsync
="--exclude=${exclude} ${excludes_rsync}"
88 ## Note: These small folders have items that previously were not published,
89 ## but there's no real cost to including them, and excluding them seems
90 ## likely to cause confusion as the codebase evolves:
91 ## packages/Files packages/PHP packages/Text
93 [ ! -d "$to" ] && mkdir
"$to"
94 $DM_RSYNC -avC $excludes_rsync --include=core
"$repo/./" "$to/./"
97 ## Copy Drupal-integration module
98 ## usage: dm_install_drupal <drupal_repo_path> <to_path>
99 function dm_install_drupal
() {
102 dm_install_dir
"$repo" "$to"
104 # set full version in .info files
105 local MODULE_DIRS
=`find "$to" -type f -name "*.info"`
106 for INFO
in $MODULE_DIRS; do
107 if [ $
(uname
) = "Darwin" ]; then
109 sed -i '' "s/version = [1-9.]*/version = $DM_VERSION/g" $INFO
112 sed -i'' "s/version = [1-9.]*/version = $DM_VERSION/g" $INFO
117 ## Copy Joomla-integration module
118 ## usage: dm_install_joomla <joomla_repo_path> <to_path>
119 function dm_install_joomla
() {
122 dm_install_dir
"$repo" "$to"
124 ## Before this change, the zip file included the joomla-integration
125 ## modules twice. The two were basically identical -- except that
126 ## one included .gitignore and the omitted it. We'll now omit it
128 rm -f "$to/.gitignore"
131 ## usage: dm_install_l10n <l10n_repo_path> <to_path>
132 function dm_install_l10n
() {
135 dm_install_dir
"$repo" "$to"
138 ## Copy composer's "vendor" folder
139 ## usage: dm_install_vendor <from_path> <to_path>
140 function dm_install_vendor
() {
144 local excludes_rsync
=""
145 for exclude
in .git .svn
{T
,t
}est
{,s
} {D
,d
}oc
{,s
} {E
,e
}xample
{,s
} ; do
146 excludes_rsync
="--exclude=${exclude} ${excludes_rsync}"
149 ## Note: These small folders have items that previously were not published,
150 ## but there's no real cost to including them, and excluding them seems
151 ## likely to cause confusion as the codebase evolves:
152 ## packages/Files packages/PHP packages/Text
154 [ ! -d "$to" ] && mkdir
"$to"
155 $DM_RSYNC -avC $excludes_rsync --include=core
"$repo/./" "$to/./"
158 ## usage: dm_install_wordpress <wp_repo_path> <to_path>
159 function dm_install_wordpress
() {
163 if [ ! -d "$to" ]; then
169 --exclude=civicrm.config.php.wordpress \
170 --exclude=.gitignore \
173 ## Need --exclude=civicrm for self-building on WP site
176 ## Generate the composer "vendor" folder
177 ## usage: dm_generate_vendor <repo_path>
178 function dm_generate_vendor
() {
185 ## Generate civicrm-version.php
186 ## usage: dm_generate_version <file> <ufname>
187 function dm_generate_version
() {
193 function civicrmVersion( ) {
194 return array( 'version' => '$DM_VERSION',
196 'revision' => '$DM_REVISION' );
201 ## Perform a hard checkout on a given report
202 ## usage: dm_git_checkout <repo_path> <tree-ish>
203 function dm_git_checkout
() {
210 ## Install npm packages
211 ## usage: dm_npm_install <path>
212 function dm_npm_install
() {