Skip to content

Commit d5ca227

Browse files
committed
fix: .basalt/generated now properly generates
1 parent 7a88eb0 commit d5ca227

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.basalt/

pkg/lib/commands/do-install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ do-install() {
1313

1414
# 'basalt.toml' is guaranteed to exist due to 'util.init_local'
1515
if util.get_toml_array "$BASALT_LOCAL_PROJECT_DIR/basalt.toml" 'dependencies'; then
16-
pkg.install_package "$BASALT_LOCAL_PROJECT_DIR" 'strict' "${REPLIES[@]}"
16+
local -a dependencies=("${REPLIES[@]}")
17+
pkg.install_package "$BASALT_LOCAL_PROJECT_DIR" 'strict' "${dependencies[@]}"
18+
pkg.phase_local_integration_recursive "$BASALT_LOCAL_PROJECT_DIR" 'yes' 'strict' "${dependencies[@]}"
1719
fi
20+
pkg.phase_local_integration_nonrecursive "$BASALT_LOCAL_PROJECT_DIR"
1821
}

pkg/lib/util/pkg.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ pkg.install_package() {
3434
# Only after all the dependencies are installed do we muck with the global packages
3535
pkg.phase_global_integration "$package_id"
3636
done; unset pkg
37-
38-
# TODO: make this happen only once (recursion)
39-
# Only if all the previous modifications to the global package store has been successfull
40-
# do we muck with the current local project
41-
pkg.phase_local_integration_recursive "$project_dir" 'yes' "$symlink_mode" "$@"
42-
pkg.phase_local_integration_nonrecursive "$project_dir"
4337
}
4438

4539
# @description Downloads package tarballs from the internet to the global store. If a git revision is specified, it
@@ -171,6 +165,7 @@ pkg.phase_local_integration_recursive() {
171165

172166
ensure.nonzero 'original_package_dir'
173167
ensure.nonzero 'is_direct'
168+
ensure.nonzero 'symlink_mode'
174169

175170
local pkg=
176171
for pkg; do
@@ -222,11 +217,11 @@ pkg.phase_local_integration_recursive() {
222217
# @description Generate scripts for './.basalt/generated' directory
223218
pkg.phase_local_integration_nonrecursive() {
224219
local project_dir="$1"
225-
local mode="$2"
220+
ensure.nonzero 'project_dir'
226221

227222
# Create generated files
228223
local content=
229-
if [ -d "$project_dir/basalt.toml" ]; then
224+
if [ -f "$project_dir/basalt.toml" ]; then
230225
if util.get_toml_array "$project_dir/basalt.toml" 'sourceDirs'; then
231226
if ((${#REPLIES[@]} > 0)); then
232227
# TODO output to file descriptor with exec
@@ -252,5 +247,4 @@ done
252247
fi
253248
fi
254249
fi
255-
256250
}

0 commit comments

Comments
 (0)