WIP: ardmk-init more verbose about directory operating in

This commit is contained in:
John Whittington 2017-09-25 10:45:14 +00:00
parent 91604be7cc
commit 8819e761fb

8
bin/ardmk-init Normal file → Executable file
View file

@ -32,8 +32,8 @@ directory = args.directory
def generateMakefile(): def generateMakefile():
src_dir = "" src_dir = ""
puts(colored.cyan("Generating Arduino Makefile...")) puts(colored.cyan("Generating Arduino Ard-Makefile project in " + os.path.abspath(directory)))
puts(colored.red("Any existing Makefile in current directory will be overwritten!!")) puts(colored.red("Any existing Makefile in " + os.path.abspath(directory) + " will be overwritten!!"))
# Header # Header
fileContents = "# Generated by ard-make version " + VERSION + "\n\n" fileContents = "# Generated by ard-make version " + VERSION + "\n\n"
btag = prompt.query('Board tag?', default='uno') btag = prompt.query('Board tag?', default='uno')
@ -111,7 +111,7 @@ def writeToMakefile(fileContents, path):
def writeTemplate(filename): def writeTemplate(filename):
src = open((filename + ".ino"),'w') src = open((filename + ".ino"),'w')
puts(colored.cyan("Writing " + filename + ".ino...")) puts(colored.cyan("Writing " + os.path.abspath(filename) + ".ino..."))
if args.verbose: if args.verbose:
puts(colored.yellow(ard_template)) puts(colored.yellow(ard_template))
src.write("/* Project: " + filename + " */\n" + ard_template) src.write("/* Project: " + filename + " */\n" + ard_template)
@ -120,7 +120,7 @@ def writeTemplate(filename):
def checkCreateFolder(folder): def checkCreateFolder(folder):
if folder and not folder == 'AUTO': if folder and not folder == 'AUTO':
if not os.path.exists(folder): if not os.path.exists(folder):
puts(colored.cyan(("Creating " + folder + " folder"))) puts(colored.cyan(("Creating " + os.path.abspath(folder) + " folder")))
os.makedirs(folder) os.makedirs(folder)
def checkDefine(define, user): def checkDefine(define, user):