Skip to content

Commit d8d8a79

Browse files
committed
refactor: Use proper function names for pkg.phase* functions
1 parent 2f8365d commit d8d8a79

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pkg/lib/util/pkg.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ pkg.install_package() {
4141
local package_id="$REPLY"
4242

4343
# Download, extract
44-
pkg.phase-download_tarball "$repo_type" "$url" "$site" "$package" "$version"
45-
pkg.phase-extract_tarball "$package_id"
44+
pkg.phase_download_tarball "$repo_type" "$url" "$site" "$package" "$version"
45+
pkg.phase_extract_tarball "$package_id"
4646

4747
# Install transitive dependencies if they exist
4848
if [ -f "$BASALT_GLOBAL_DATA_DIR/store/packages/$package_id/basalt.toml" ]; then
@@ -52,19 +52,19 @@ pkg.install_package() {
5252
fi
5353

5454
# 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"
5656
done
5757
unset pkg
5858

5959
# Only if all the previous modifications to the global package store has been successfull
6060
# 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"
6363
}
6464

6565
# @description Downloads package tarballs from the internet to the global store. If a git revision is specified, it
6666
# will extract that revision after cloning the repository and using git-archive
67-
pkg.phase-download_tarball() {
67+
pkg.phase_download_tarball() {
6868
local repo_type="$1"
6969
local url="$2"
7070
local site="$3"
@@ -139,7 +139,7 @@ pkg.phase-download_tarball() {
139139
}
140140

141141
# @description Extracts the tarballs in the global store to a directory
142-
pkg.phase-extract_tarball() {
142+
pkg.phase_extract_tarball() {
143143
local package_id="$1"
144144
ensure.nonzero 'package_id'
145145

@@ -172,7 +172,7 @@ pkg.phase-extract_tarball() {
172172

173173
# TODO: properly cache transformations
174174
# @description This performs modifications a particular package in the global store
175-
pkg.phase-global-integration() {
175+
pkg.phase_global-integration() {
176176
local package_id="$1"
177177
ensure.nonzero 'package_id'
178178

@@ -186,16 +186,16 @@ pkg.phase-global-integration() {
186186
if [ -f "$project_dir/basalt.toml" ]; then
187187
# Install dependencies
188188
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"
191191
fi
192192
fi
193193

194194
print.indent-green "Transformed" "$package_id"
195195
}
196196

197197
# Create a './.basalt' directory for a particular project directory
198-
pkg.phase-local-integration() {
198+
pkg.phase_local-integration() {
199199
unset REPLY; REPLY=
200200
local original_package_dir="$1"
201201
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() {
247247
ensure.dir "$BASALT_GLOBAL_DATA_DIR/store/packages/$package_id"
248248
if [ -f "$BASALT_GLOBAL_DATA_DIR/store/packages/$package_id/basalt.toml" ]; then
249249
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[@]}"
251251
fi
252252
fi
253253
done
254254
unset pkg
255255
}
256256

257257
# @description Generate scripts for './.basalt/generated' directory
258-
pkg.phase-local-generate-scripts() {
258+
pkg.phase_local-generate-scripts() {
259259
local project_dir="$1"
260260
local mode="$2"
261261

0 commit comments

Comments
 (0)