diff --git a/src/bot/precompile_include.jl b/src/bot/precompile_include.jl index 7fc6a7aaf..d91c8a9f3 100644 --- a/src/bot/precompile_include.jl +++ b/src/bot/precompile_include.jl @@ -23,28 +23,6 @@ allos_funs = [ return os, osfun end ################################################################ -""" - precompile_pather(package_name::String) - precompile_pather_multios(package_name::String) - -To get the path of precompile_package_name.jl file - -Written exclusively for SnoopCompile Github actions. -# Examples -```julia -precompile_path, precompileFolder = precompile_pather("MatLang") -``` -""" -function precompile_pather(package_name::String) - return "\"../deps/SnoopCompile/precompile/precompile_$package_name.jl\"", - "$(pwd())/deps/SnoopCompile/precompile/" -end -function precompile_pather_multios(package_name::String) - os = detectos()[1] - return "\"../deps/SnoopCompile/precompile/$os/precompile_$package_name.jl\"", - "$(pwd())/deps/SnoopCompile/precompile/$os" -end -################################################################ """ new_includer_file(package_path::String, precompile_path::String) diff --git a/src/bot/snoopi_bot.jl b/src/bot/snoopi_bot.jl index 21ac5c486..3d072c497 100644 --- a/src/bot/snoopi_bot.jl +++ b/src/bot/snoopi_bot.jl @@ -26,10 +26,17 @@ macro snoopi_bot(config::BotConfig, snoop_script) package_name = config.package_name blacklist = config.blacklist subst = config.subst - ismultios = config.ismultios + os = config.os ################################################################ package_path = joinpath(pwd(),"src","$package_name.jl") - precompile_path, precompileFolder = precompile_pather(package_name, ismultios) + + # precompile folder for writing + if isnothing(os) + precompile_folder = "$(pwd())/deps/SnoopCompile/precompile/" + else + precompile_folder = "$(pwd())/deps/SnoopCompile/precompile/$(detectOS()[1])" + end + quote packageSym = Symbol($package_name) ################################################################ @@ -47,7 +54,7 @@ macro snoopi_bot(config::BotConfig, snoop_script) ### Parse the compiles and generate precompilation scripts pc = SnoopCompile.parcel(data, subst = $subst, blacklist = $blacklist) onlypackage = Dict( packageSym => sort(pc[packageSym]) ) - SnoopCompile.write($precompileFolder,onlypackage) + SnoopCompile.write($precompile_folder,onlypackage) ################################################################ precompile_activator($package_path, $precompile_path) end