Skip to content

Commit 24eb3f9

Browse files
committed
Fix handling of memory limit command line argument
If a string of only numerals is passed as argument we assume it should be converted to an integer and specifies a size in bytes.
1 parent eb551eb commit 24eb3f9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

repo2docker/__main__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,12 @@ def make_r2d(argv=None):
299299
r2d.user_name = args.user_name
300300

301301
if args.build_memory_limit:
302-
r2d.build_memory_limit = args.build_memory_limit
302+
# if the string only contains numerals we assume it should be an int
303+
# and specifies a size inn bytes
304+
if args.build_memory_limit.isnumeric():
305+
r2d.build_memory_limit = int(args.build_memory_limit)
306+
else:
307+
r2d.build_memory_limit = args.build_memory_limit
303308

304309
if args.environment and not r2d.run:
305310
print('To specify environment variables, you also need to run '

0 commit comments

Comments
 (0)