File tree 4 files changed +58
-0
lines changed
4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 9
9
" after" ,
10
10
" -Promise"
11
11
],
12
+ "expr" : true ,
12
13
"proto" : true ,
13
14
"strict" : true ,
14
15
"indent" : 2 ,
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ var SilentError = require('../errors/silent');
9
9
var chalk = require ( 'chalk' ) ;
10
10
var cpd = require ( 'ember-cli-copy-dereference' ) ;
11
11
12
+ var attemptNeverIndex = require ( '../utilities/attempt-never-index' ) ;
13
+
12
14
var signalsTrapped = false ;
13
15
14
16
module . exports = Task . extend ( {
@@ -71,6 +73,8 @@ module.exports = Task.extend({
71
73
fs . mkdirsSync ( outputPath ) ;
72
74
}
73
75
76
+ attemptNeverIndex ( outputPath ) ;
77
+
74
78
resolve ( cpd . sync ( inputPath , outputPath ) ) ;
75
79
} ) ;
76
80
} ,
@@ -109,6 +113,8 @@ module.exports = Task.extend({
109
113
args . push ( arguments [ i ] ) ;
110
114
}
111
115
116
+ attemptNeverIndex ( 'tmp' ) ;
117
+
112
118
return this . processAddonBuildSteps ( 'preBuild' )
113
119
. then ( function ( ) {
114
120
return self . builder . build . apply ( self . builder , args ) ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var isDarwin = / d a r w i n / i. test ( require ( 'os' ) . type ( ) ) ;
4
+ var debug = require ( 'debug' ) ( 'ember-cli:utilities/attempt-metadata-index-file' ) ;
5
+
6
+ module . exports = function ( dir ) {
7
+ var path = dir + '/.metadata_never_index' ;
8
+
9
+ if ( ! isDarwin ) {
10
+ debug ( 'not darwin, skipping %s (which hints to spotlight to prevent indexing)' , path ) ;
11
+ return ;
12
+ }
13
+
14
+ debug ( 'creating: %s (to prevent spotlight indexing)' , path ) ;
15
+
16
+ var fs = require ( 'fs-extra' ) ;
17
+
18
+ fs . mkdirsSync ( dir ) ;
19
+ fs . writeFileSync ( path ) ;
20
+ } ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var attemptNeverIndex = require ( '../../../lib/utilities/attempt-never-index' ) ;
4
+ var quickTemp = require ( 'quick-temp' ) ;
5
+ var fs = require ( 'fs-extra' ) ;
6
+ var expect = require ( 'chai' ) . expect ;
7
+ var isDarwin = / d a r w i n / i. test ( require ( 'os' ) . type ( ) ) ;
8
+
9
+ describe ( 'attempt-never-index' , function ( ) {
10
+ var context = { } ;
11
+ var tmpPath ;
12
+ before ( function ( ) {
13
+ tmpPath = quickTemp . makeOrRemake ( context , 'attempt-never-index' ) ;
14
+ } ) ;
15
+
16
+ after ( function ( ) {
17
+ quickTemp . remove ( context , 'attempt-never-index' ) ;
18
+ } ) ;
19
+
20
+ it ( 'sets the hint to spotlight if possible' , function ( ) {
21
+ expect ( fs . existsSync ( tmpPath + '/.metadata_never_index' ) ) . to . false ;
22
+
23
+ attemptNeverIndex ( tmpPath ) ;
24
+
25
+ if ( isDarwin ) {
26
+ expect ( fs . existsSync ( tmpPath + '/.metadata_never_index' ) ) . to . true ;
27
+ } else {
28
+ expect ( fs . existsSync ( tmpPath + '/.metadata_never_index' ) ) . to . false ;
29
+ }
30
+ } ) ;
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments