File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 2
2
"$schema" : " https://raw.githubusercontent.com/denoland/deno/348900b8b79f4a434cab4c74b3bc8d4d2fa8ee74/cli/schemas/config-file.v1.json" ,
3
3
"name" : " @valtown/vt" ,
4
4
"description" : " The Val Town CLI" ,
5
- "version" : " 0.1.43 " ,
5
+ "version" : " 0.1.44 " ,
6
6
"exports" : " ./vt.ts" ,
7
7
"license" : " MIT" ,
8
8
"tasks" : {
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ Deno.test({
59
59
"create" ,
60
60
nonEmptyDirValName ,
61
61
] , tmpDir ) ;
62
- console . log ( stdout ) ;
63
62
assertStringIncludes (
64
63
stdout ,
65
64
"files will be uploaded" ,
@@ -217,6 +216,15 @@ Deno.test({
217
216
join ( tmpDir , "another-file.ts" ) ,
218
217
"export const value = 42;" ,
219
218
) ;
219
+ await Deno . mkdir ( join ( tmpDir , "foo" ) ) ;
220
+ await Deno . writeTextFile (
221
+ join ( tmpDir , "foo/.vtignore" ) ,
222
+ "ignored-file.txt" ,
223
+ ) ;
224
+ await Deno . writeTextFile (
225
+ join ( tmpDir , "ignored-file.txt" ) ,
226
+ "This file should not be uploaded" ,
227
+ ) ;
220
228
} ) ;
221
229
222
230
await t . step ( "create Val in current directory" , async ( ) => {
@@ -258,6 +266,10 @@ Deno.test({
258
266
fileNames . includes ( "another-file.ts" ) ,
259
267
"another-file.ts should be uploaded to Val" ,
260
268
) ;
269
+ assert (
270
+ ! fileNames . includes ( "ignored-file.txt" ) ,
271
+ "ignored-file.txt should be ignored and not uploaded to Val" ,
272
+ ) ;
261
273
} ) ;
262
274
} ) ;
263
275
} ,
Original file line number Diff line number Diff line change @@ -280,12 +280,20 @@ export default class VTClient {
280
280
await assertSafeDirectory ( rootPath ) ;
281
281
}
282
282
283
+ // If the directory exists, make a VTMeta in it, and gather the gitignore rules
284
+ let gitignoreRules : string [ ] = [ ] ;
285
+ if ( await exists ( rootPath ) ) {
286
+ const meta = new VTMeta ( rootPath ) ;
287
+ gitignoreRules = await meta . loadGitignoreRules ( ) ;
288
+ }
289
+
283
290
// First create the val (this uploads it too)
284
291
const { newValId } = await create ( {
285
292
sourceDir : rootPath ,
286
293
valName,
287
294
privacy,
288
295
description,
296
+ gitignoreRules,
289
297
} ) ;
290
298
291
299
// Get the Val branch
You can’t perform that action at this time.
0 commit comments