Skip to content

Commit

Permalink
builder init if only build operotion selected
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Aug 9, 2024
1 parent d69325f commit ba53e25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/operations/package-manager/build.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
private bool no_src = false;
private static bool builder_init = false;
private static int build_operation (string[] args) {
if(!builder_init){
builder_ctx_init();
builder_init = true;
}
string current_directory=pwd ();
string[] new_args = args;
if (new_args.length == 0) {
Expand Down
8 changes: 5 additions & 3 deletions tool/mkctx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function list_txt(){
find src/shcode -type f -exec basename {} \; | sed "s/\..*//g" | sort
}
### ctx_init function build
echo "private static void builder_ctx_init(){" >> ctx.vala
for target_name in $(list_build_targets) ; do
echo " build_target_${target_name/-/_}_init();"
done >> ctx.vala
echo "}" >> ctx.vala
echo "private static void ctx_init(){" >> ctx.vala
for i in $@ ; do
name=$(echo $i | cut -f1 -d=)
Expand All @@ -32,9 +37,6 @@ for op_name in $(list_operations) ; do
echo -n "\"${op_name}\", "
done >> ctx.vala
echo "};" >> ctx.vala
for target_name in $(list_build_targets) ; do
echo " build_target_${target_name/-/_}_init();"
done >> ctx.vala
for op_name in $(list_operations) ; do
echo " ${op_name/-/_}_init();"
done >> ctx.vala
Expand Down

0 comments on commit ba53e25

Please sign in to comment.