This repository was archived by the owner on Jun 14, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ var command = {
44 builder : { } ,
55 run : function ( options , done ) {
66 var OS = require ( "os" ) ;
7+ var path = require ( 'path' ) ;
78 var dir = require ( "node-dir" ) ;
89 var temp = require ( "temp" ) ;
910 var Config = require ( "truffle-config" ) ;
@@ -43,12 +44,31 @@ var command = {
4344 dir . files ( config . test_directory , callback ) ;
4445 } ;
4546
47+ function getTestTempDir ( cb ) {
48+ var tempDir = path . join ( config . working_directory , '.tmp' ) ;
49+ var testDir = path . join ( tempDir , 'test' ) ;
50+
51+ try {
52+ if ( ! fs . existsSync ( tempDir ) ) {
53+ fs . mkdirSync ( tempDir ) ;
54+ }
55+
56+ if ( ! fs . existsSync ( testDir ) ) {
57+ fs . mkdirSync ( testDir ) ;
58+ }
59+
60+ cb ( null , testDir ) ;
61+ } catch ( err ) {
62+ cb ( err ) ;
63+ }
64+ }
65+
4666 getFiles ( function ( err , files ) {
4767 files = files . filter ( function ( file ) {
4868 return file . match ( config . test_file_extension_regexp ) != null ;
4969 } ) ;
5070
51- temp . mkdir ( 'test-' , function ( err , temporaryDirectory ) {
71+ getTestTempDir ( function ( err , temporaryDirectory ) {
5272 if ( err ) return done ( err ) ;
5373
5474 function cleanup ( ) {
You can’t perform that action at this time.
0 commit comments