mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:22:46 +00:00 
			
		
		
		
	Meta: Allow serenity.sh to be used outside of assumed working directory
This change fixes two bugs:
1) If you run `serenity.sh` outside of your serenity git clone, the
   `get_top_dir()` function won't be able to auto detect the serenity
    root dir and we'll error out. By allowing the script to use an
    existing $SERENITY_ROOT vlaue if it exists, we can solve
    this problem.
2) If tried to run a command which ends up calling `build_toolchain()`
   and you were outside of the root of the project, it should just
   fail. Fix this by utilizing `$SERENITY_ROOT`.
			
			
This commit is contained in:
		
							parent
							
								
									127fe38612
								
							
						
					
					
						commit
						253114e3b1
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		|  | @ -104,8 +104,11 @@ create_build_dir() { | |||
| 
 | ||||
| cmd_with_target() { | ||||
|     is_valid_target || ( >&2 echo "Unknown target: $TARGET"; usage ) | ||||
| 
 | ||||
|     if [ ! -d "$SERENITY_ROOT" ]; then | ||||
|         SERENITY_ROOT="$(get_top_dir)" | ||||
|         export SERENITY_ROOT | ||||
|     fi | ||||
|     BUILD_DIR="$SERENITY_ROOT/Build/$TARGET" | ||||
|     if [ "$TARGET" != "lagom" ]; then | ||||
|         export SERENITY_ARCH="$TARGET" | ||||
|  | @ -136,7 +139,7 @@ delete_target() { | |||
| } | ||||
| 
 | ||||
| build_toolchain() { | ||||
|     ( cd Toolchain && ARCH="$TARGET" ./BuildIt.sh ) | ||||
|     ( cd "$SERENITY_ROOT/Toolchain" && ARCH="$TARGET" ./BuildIt.sh ) | ||||
| } | ||||
| 
 | ||||
| ensure_toolchain() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brian Gianforcaro
						Brian Gianforcaro