Skip to content

Commit

Permalink
COMMANDBOX-937
Browse files Browse the repository at this point in the history
  • Loading branch information
bdw429s committed Feb 23, 2019
1 parent 913e171 commit 3f1d17e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/cfml/system/services/ArtifactService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ component accessors="true" singleton {
property name='packageService' inject='PackageService';
property name='logger' inject='logbox:logger:{this}';
property name="semanticVersion" inject="provider:semanticVersion@semver";
// COMMANDBOX-479
property name="configService" inject="ConfigService";


Expand All @@ -31,7 +30,6 @@ component accessors="true" singleton {
function onDIComplete() {

// Create the artifacts directory if it doesn't exist
// COMMANDBOX-479
if( !directoryExists( getArtifactsDirectory() ) ) {
directoryCreate( getArtifactsDirectory() );
}
Expand All @@ -44,8 +42,9 @@ component accessors="true" singleton {
* @returns A struct of arrays where the struct key is the package package and the array contains the versions of that package in the cache.
*/
struct function listArtifacts( packageName='' ) {
var result = {};
// COMMANDBOX-479
// Ordered struct
var result = [:];

var dirList = directoryList( path=getArtifactsDirectory(), recurse=false, listInfo='query', sort='name asc' );

for( var dir in dirList ) {
Expand All @@ -71,7 +70,7 @@ component accessors="true" singleton {
* Removes all artifacts from the cache and returns the number of wiped out directories
*/
numeric function cleanArtifacts() {
// COMMANDBOX-479

var qryDir = directoryList( path=getArtifactsDirectory(), recurse=false, listInfo='query' );
var numRemoved = 0;

Expand Down Expand Up @@ -115,7 +114,7 @@ component accessors="true" singleton {
*/
function getPackagePath( required packageName, version="" ){
// This will likely change, so I'm only going to put the code here.
// COMMANDBOX-479

var path = getArtifactsDirectory() & '/' & arguments.packageName;
// do we have a version?
if( arguments.version.len() ){
Expand Down Expand Up @@ -267,7 +266,7 @@ component accessors="true" singleton {
}
}

// COMMANDBOX-479

string function getArtifactsDirectory() {
return configService.getSetting( 'artifactsDirectory', variables.artifactDir );
}
Expand Down

0 comments on commit 3f1d17e

Please sign in to comment.