PasBuild is a Bash script designed to enhance dependency management in Pascal. Created by Evan Perreau.
- You need FPC compiler to use this script.
-
Clone this repository to get example code or download the
pasbuild.shscript. -
Make the script executable:
chmod +x pasbuild.sh
-
You can now use the script by running:
./pasbuild.sh <file_name>
-
If you want to make it globally accessible:
sudo mv build.sh /usr/local/bin/pasbuild sudo chmod +x /usr/local/bin/pasbuild
-
You can now use the script everywhere by running:
pasbuild <file_name>-
Clone this repository to get example code or download the
pasbuild.shscript. -
To run Bash scripts on Windows, you'll need a Bash environment. One common option is Git for Windows. Install it if you haven't already.
-
Open a Git Bash shell and navigate to the directory containing the
pasbuild.shscript. -
You can now use the script by running:
bash pasbuild.sh <file_name>
-
If you want to make it globally accessible, you need to add it to your PATH:
- Open System Properties Window:
- Right-click on "This PC" (or "Computer" depending on your Windows version) on your desktop or in the Start menu.
- Select "Properties."
- Access Advanced System Settings:
- In the "System Properties" window, click on "Advanced system settings" in the left panel.
- Open Environment Variables Window:
- In the "System Properties" window, click the "Environment Variables" button in the "Advanced" tab.
- Edit the PATH Variable:
- In the "Environment Variables" window, under the "System variables" section, look for the variable named "Path" or "PATH" in the list of system variables.
- Select "Path" and click the "Edit" button.
- Add a Directory to the PATH:
- In the "Edit Environment Variable" window, click the "New" button.
- Add the full path of the directory you want to add to the PATH. For example, if you want to add "C:\Path\To\pathbuild," enter this string.
- Click "OK" to add the path.
- Save Changes:
- Click "OK" to close the "Edit Environment Variable" window.
- Click "OK" again to close the "Environment Variables" window.
- Restart the Command Prompt:
- If you already have a Command Prompt window open, close it and open a new one to apply the changes to the PATH.
-
Execute the pasbuild command
pasbuild.sh <file_name>
- You need to create a lib directory to put all your libraries in this.
- The script will check if the specified Pascal file exists and display an error message if it doesn't.
- It will index Pascal dependencies and save them to a file called
pasbuild.lock. - Then, it will compile the Pascal file with the necessary dependencies and display the compilation result.
Bash script created by Evan Perreau.