Skip to content

Python script that takes any base ASH script, and creates a new file that includes it as well as each of its imported files as well, all in one.

License

Notifications You must be signed in to change notification settings

fredg1/ASH-bundler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

ASH Bundler

to use, call bundle_and_write() with 2, 3 or 4 arguments.

argument 1, path_to_file: path to the script you want to bundle.

WARNING: this path needs to be relative to your mafia folder.
This means this value will always be either "relay/[...].ash" or "scripts/[...].ash"
(or... "planting/[...].ash", I guess..?)
example: "relay/relay_TourGuide.ash"

argument 2, path_to_result: path to the soon-to-be-created bundled file.

Can either be absolute or relative.
if relative, the reference is the folder in which THIS SCRIPT was ran.
examples: C:/Users/Keith/Documents/my_precious/my_script.ash
or my_script.ash

argument 3, path_to_folder (optional): the path to REACH YOUR MAFIA FOLDER

Can be either absolute or relative
if you run this script from within your mafia folder, don't submit anything here.
Otherwise, this is the folders that this script has to go through to reach your mafia folder
(or whatever folder contains the "scripts" and/or "relay" folder(s) containing your scripts to import)

argument 4, allow_overwrite (optional): True

The capital T matters.
A safety measure; whether or not you allow the script to act
if path_to_result already exists.
Not including it makes it default to False.

EXAMPLE:

  • you run this program from your DESKTOP
  • you want to put the result in C:/Users/Me/Desktop/Sekrits/my_bundled_script.ash
  • your script is at C:/Users/Me/Desktop/Games/Actually_entertaining_games/KoLMafia/scripts/my_script.ash

In the command line, you would do:
C:\Users\Me\Desktop> py Bundle_ASH_script.bundle_and_write( path_to_file='scripts/my_script.ash' , path_to_result='Sekrits/my_bundled_script.ash' , path_to_folder='Games/Actually_entertaining_games/KoLMafia/' )

Another way to do it would be to put, at the end of this file:
bundle_and_write( path_to_file='scripts/my_script.ash' , path_to_result='Sekrits/my_bundled_script.ash' , path_to_folder='Games/Actually_entertaining_games/KoLMafia/' )
and then run, in the command line:
C:\Users\Me\Desktop> py Bundle_ASH_script

About

Python script that takes any base ASH script, and creates a new file that includes it as well as each of its imported files as well, all in one.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages