mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-17 23:04:24 +01:00
Added check and exception for writable folders
This commit is contained in:
@@ -2,6 +2,7 @@ from argparse import ArgumentParser
|
||||
from netaddr import IPNetwork, IPRange, IPGlob
|
||||
from Interlace.lib.core.output import OutputHelper, Level
|
||||
import os.path
|
||||
from os import access, W_OK
|
||||
import sys
|
||||
from re import compile
|
||||
|
||||
@@ -68,6 +69,10 @@ class InputHelper(object):
|
||||
final_commands = set()
|
||||
output = OutputHelper(arguments)
|
||||
|
||||
# checking for whether output is writable and whether it exists
|
||||
if not access(arguments.output, W_OK):
|
||||
raise Exception("Directory provided isn't writable")
|
||||
|
||||
if arguments.port:
|
||||
if "," in arguments.port:
|
||||
ports = arguments.port.split(",")
|
||||
|
||||
Reference in New Issue
Block a user