Skip to content

Commit

Permalink
Apply cfformat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano authored and github-actions[bot] committed May 3, 2023
1 parent 54cb51d commit 94e639a
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions build/Build.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ component {
variables.apiDocsURL = "http://localhost:60299/apidocs/";
variables.testRunner = "http://localhost:60299/tests/runner.cfm";
variables.exportsDir = "";
variables.moduleName = "coldbox-cli";
variables.moduleName = "coldbox-cli";

// Source Excludes Not Added to final binary: You can use REGEX
variables.excludes = [
Expand All @@ -27,10 +27,7 @@ component {
];

// Cleanup + Init Build Directories
[
variables.buildDir,
variables.artifactsDir
].each( function( item ){
[ variables.buildDir, variables.artifactsDir ].each( function( item ){
if ( directoryExists( item ) ) {
directoryDelete( item, true );
}
Expand All @@ -48,9 +45,9 @@ component {
* Run the build process: test, build source, docs, checksums
*
* @projectName The project name used for resources and slugs
* @version The version you are building
* @buldID The build identifier
* @branch The branch you are building
* @version The version you are building
* @buldID The build identifier
* @branch The branch you are building
*/
function run(
required projectName,
Expand Down Expand Up @@ -113,9 +110,9 @@ component {
* Build the source
*
* @projectName The project name used for resources and slugs
* @version The version you are building
* @buldID The build identifier
* @branch The branch you are building
* @version The version you are building
* @buldID The build identifier
* @branch The branch you are building
*/
function buildSource(
required projectName,
Expand All @@ -135,18 +132,11 @@ component {

// Project Build Dir
variables.projectBuildDir = variables.buildDir & "/#projectName#";
directoryCreate(
variables.projectBuildDir,
true,
true
);
directoryCreate( variables.projectBuildDir, true, true );

// Copy source
print.blueLine( "Copying source to build folder..." ).toConsole();
copy(
variables.cwd,
variables.projectBuildDir
);
copy( variables.cwd, variables.projectBuildDir );

// Create build ID
fileWrite(
Expand Down Expand Up @@ -185,10 +175,7 @@ component {
);

// Copy box.json for convenience
fileCopy(
"#variables.projectBuildDir#/box.json",
variables.exportsDir
);
fileCopy( "#variables.projectBuildDir#/box.json", variables.exportsDir );
}

/**
Expand Down Expand Up @@ -298,11 +285,8 @@ component {
/**
* Ensure the export directory exists at artifacts/NAME/VERSION/
*/
private function ensureExportDir(
required projectName,
version = "1.0.0"
){
if ( structKeyExists( variables, "exportsDir" ) && directoryExists( variables.exportsDir ) ){
private function ensureExportDir( required projectName, version = "1.0.0" ){
if ( structKeyExists( variables, "exportsDir" ) && directoryExists( variables.exportsDir ) ) {
return;
}
// Prepare exports directory
Expand Down

0 comments on commit 94e639a

Please sign in to comment.