File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ module.exports = function(grunt) {
19
19
}
20
20
} ,
21
21
22
+ version : {
23
+ dist : {
24
+ dest : 'dist/version.json'
25
+ }
26
+ } ,
27
+
22
28
copy : {
23
29
dist : {
24
30
files : [ {
@@ -150,7 +156,8 @@ module.exports = function(grunt) {
150
156
'concat' ,
151
157
'copy' ,
152
158
'uglify' ,
153
- 'string-replace'
159
+ 'string-replace' ,
160
+ 'version'
154
161
] ) ;
155
162
156
163
grunt . registerMultiTask ( 'karma' , 'Run karma' , function ( ) {
@@ -171,4 +178,19 @@ module.exports = function(grunt) {
171
178
done ( ) ;
172
179
} ) ;
173
180
} ) ;
181
+
182
+ grunt . registerMultiTask ( 'version' , 'Generate version JSON' , function ( ) {
183
+ var pkg = grunt . config ( 'pkg' ) ;
184
+ this . files . forEach ( function ( file ) {
185
+ var dest = file . dest ;
186
+ var d = new Date ( ) ;
187
+ var version = {
188
+ version : pkg . version ,
189
+ codename : pkg . codename ,
190
+ date : grunt . template . today ( 'yyyy-mm-dd' ) ,
191
+ time : d . getUTCHours ( ) + ':' + d . getUTCMinutes ( ) + ':' + d . getUTCSeconds ( )
192
+ } ;
193
+ grunt . file . write ( dest , JSON . stringify ( version , null , 2 ) ) ;
194
+ } ) ;
195
+ } ) ;
174
196
} ;
Original file line number Diff line number Diff line change @@ -33,9 +33,6 @@ function run {
33
33
cd $VERSION_DIR
34
34
cp -R $BUILD_DIR /* $VERSION_DIR
35
35
36
- # Create a version.txt file with the version and codename
37
- echo " $VERSION $CODENAME " > version.txt
38
-
39
36
echo " -- Generating versions.json..."
40
37
cd $IONIC_CODE_DIR /builder
41
38
python ./generate.py > /dev/null
You can’t perform that action at this time.
0 commit comments