---
title: "Build Pattern: Location Agnostic Script"
url: "https://osherove.com/blog/2013/1/19/build-pattern-location-agnostic-script.md"
canonical: "https://osherove.com/blog/2013/1/19/build-pattern-location-agnostic-script.html"
published: "2013-01-19T13:38:20"
updated: "2013-01-19T13:38:20"
tags: ["Build Bullet"]
author: "Roy Osherove"
description: "Symptoms: Running the build script on a machine where it was never run before requires extra pre-work to make the machine ready, such as mapping drives, creating a special build script folder etc. Problem: The build…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Build Pattern: Location Agnostic Script

By Roy Osherove January 19, 2013 In [Build Bullet](https://osherove.com/blog/category/build-bullet)

**Historical article** · Originally published January 19, 2013; technical details may be outdated.

Symptoms:

- Running the build script on a machine where it was never run before requires extra pre-work to make the machine ready, such as mapping drives, creating a special build script folder etc.

Problem:

- The build script uses hardcoded file and directory paths to find its dependent source files. For example, it searches for a solution file in Z:/SolutionFileName . That means the build script has specific requirements from its environment before running, which causes lots of menial, boring work to do before being able to run it.

Solution:

- Have the script use only relative paths to find files.
- Make the script part of source control, or deploy it into the root of the source control branch to build, so that it has access to all the files it needs

## More in Build Bullet

[All posts in Build Bullet](https://osherove.com/blog/category/build-bullet)

- Jan 19, 2013

    ### [Build Pattern: Extract Script](https://osherove.com/blog/2013/1/19/build-pattern-extract-script.html)

- Jan 19, 2013

    ### [Build Pattern: Fill In the Blanks](https://osherove.com/blog/2013/1/19/build-pattern-fill-in-the-blanks.html)

- Jan 7, 2013

    ### [Build Pattern: Shipping Skeleton](https://osherove.com/blog/2013/1/7/build-pattern-shipping-skeleton.html)

- Dec 6, 2012

    ### [Build Bullet #5– How to make your builds FAST using DRY and SRP Principles](https://osherove.com/blog/2012/12/6/build-bullet-5ndash-how-to-make-your-builds-fast-using-dry-a.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
