@@ -52,14 +52,14 @@ pkg.install_package() {
52
52
fi
53
53
54
54
# Only after all the dependencies are installed do we muck with the package
55
- pkg.phase_global-integration " $package_id "
55
+ pkg.phase_global_integration " $package_id "
56
56
done
57
57
unset pkg
58
58
59
59
# Only if all the previous modifications to the global package store has been successfull
60
60
# do we muck with the current local project
61
- pkg.phase_local-integration " $project_dir " ' yes' " $symlink_mode " " $@ "
62
- pkg.phase_local-generate -scripts " $project_dir "
61
+ pkg.phase_local_integration " $project_dir " ' yes' " $symlink_mode " " $@ "
62
+ pkg.phase_local_generate -scripts " $project_dir "
63
63
}
64
64
65
65
# @description Downloads package tarballs from the internet to the global store. If a git revision is specified, it
@@ -172,7 +172,7 @@ pkg.phase_extract_tarball() {
172
172
173
173
# TODO: properly cache transformations
174
174
# @description This performs modifications a particular package in the global store
175
- pkg.phase_global-integration () {
175
+ pkg.phase_global_integration () {
176
176
local package_id=" $1 "
177
177
ensure.nonzero ' package_id'
178
178
@@ -186,16 +186,16 @@ pkg.phase_global-integration() {
186
186
if [ -f " $project_dir /basalt.toml" ]; then
187
187
# Install dependencies
188
188
if util.get_toml_array " $project_dir /basalt.toml" ' dependencies' ; then
189
- pkg.phase_local-integration " $project_dir " ' yes' ' strict' " ${REPLIES[@]} "
190
- pkg.phase_local-generate -scripts " $project_dir "
189
+ pkg.phase_local_integration " $project_dir " ' yes' ' strict' " ${REPLIES[@]} "
190
+ pkg.phase_local_generate -scripts " $project_dir "
191
191
fi
192
192
fi
193
193
194
194
print.indent-green " Transformed" " $package_id "
195
195
}
196
196
197
197
# Create a './.basalt' directory for a particular project directory
198
- pkg.phase_local-integration () {
198
+ pkg.phase_local_integration () {
199
199
unset REPLY; REPLY=
200
200
local original_package_dir=" $1 "
201
201
local is_direct=" $2 " # Whether the "$package_dir" dependency is a direct or transitive dependency of "$original_package_dir"
@@ -247,15 +247,15 @@ pkg.phase_local-integration() {
247
247
ensure.dir " $BASALT_GLOBAL_DATA_DIR /store/packages/$package_id "
248
248
if [ -f " $BASALT_GLOBAL_DATA_DIR /store/packages/$package_id /basalt.toml" ]; then
249
249
if util.get_toml_array " $BASALT_GLOBAL_DATA_DIR /store/packages/$package_id /basalt.toml" ' dependencies' ; then
250
- pkg.phase_local-integration " $original_package_dir " ' no' ' strict' " ${REPLIES[@]} "
250
+ pkg.phase_local_integration " $original_package_dir " ' no' ' strict' " ${REPLIES[@]} "
251
251
fi
252
252
fi
253
253
done
254
254
unset pkg
255
255
}
256
256
257
257
# @description Generate scripts for './.basalt/generated' directory
258
- pkg.phase_local-generate -scripts () {
258
+ pkg.phase_local_generate -scripts () {
259
259
local project_dir=" $1 "
260
260
local mode=" $2 "
261
261
@@ -269,8 +269,11 @@ pkg.phase_local-generate-scripts() {
269
269
for source_dir in " ${REPLIES[@]} " ; do
270
270
# TODO: use BASALT_GLOBAL_DATA_DIR
271
271
printf -v content ' %s%s\n' " $content " " for __basalt_f in \" $project_dir /$source_dir \" /*; do
272
- source \"\$ __basalt_f\"
273
- done"
272
+ if [ -f \"\$ __basalt_f\" ]; then
273
+ source \"\$ __basalt_f\"
274
+ fi
275
+ done
276
+ "
274
277
done
275
278
unset source_dir
276
279
0 commit comments