@@ -1070,10 +1070,7 @@ def __init__(self, path=None, print_warning=False):
1070
1070
err = (
1071
1071
"Could not find mbed program in current path. Assuming current dir.\n "
1072
1072
"You can fix this by calling \" mbed new .\" in the root dir of your program" )
1073
- if print_warning :
1074
- warning (err )
1075
- else :
1076
- error (err , 1 )
1073
+ warning (err ) if print_warning else error (err , 1 )
1077
1074
1078
1075
# Sets config value
1079
1076
def set_cfg (self , var , val ):
@@ -1664,7 +1661,7 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
1664
1661
# Gather remaining arguments
1665
1662
args = remainder
1666
1663
# Find the root of the program
1667
- program = Program (os .getcwd (), False )
1664
+ program = Program (os .getcwd (), True )
1668
1665
# Remember the original path. this is needed for compiling only the libraries and tests for the current folder.
1669
1666
orig_path = os .getcwd ()
1670
1667
@@ -1743,11 +1740,11 @@ def test(tlist=False):
1743
1740
# Gather remaining arguments
1744
1741
args = remainder
1745
1742
# Find the root of the program
1746
- program = Program (os .getcwd (), False )
1743
+ program = Program (os .getcwd (), True )
1747
1744
# Change directories to the program root to use mbed OS tools
1748
1745
with cd (program .path ):
1749
1746
if not program .get_tools_dir ():
1750
- error ('The mbed OS codebase or tools were not found in "%s".' % program .path , - 1 )
1747
+ error ('The mbed tools were not found in "%s".' % program .path , - 1 )
1751
1748
1752
1749
# Prepare environment variables
1753
1750
env = os .environ .copy ()
@@ -1769,11 +1766,11 @@ def export(ide=None, mcu=None):
1769
1766
# Gather remaining arguments
1770
1767
args = remainder
1771
1768
# Find the root of the program
1772
- program = Program (os .getcwd (), False )
1769
+ program = Program (os .getcwd (), True )
1773
1770
# Change directories to the program root to use mbed OS tools
1774
1771
with cd (program .path ):
1775
1772
if not program .get_tools_dir ():
1776
- error ('The mbed OS codebase or tools were not found in "%s".' % program .path , - 1 )
1773
+ error ('The mbed tools were not found in "%s".' % program .path , - 1 )
1777
1774
1778
1775
target = mcu if mcu else program .get_cfg ('TARGET' )
1779
1776
if target is None :
@@ -1813,7 +1810,7 @@ def toolchain_(name=None):
1813
1810
help = 'Sets or get program default options.' )
1814
1811
def default_ (name , value = None ):
1815
1812
# Find the root of the program
1816
- program = Program (os .getcwd (), False )
1813
+ program = Program (os .getcwd ())
1817
1814
# Change current dir to program root
1818
1815
with cd (program .path ):
1819
1816
var = str (name ).upper ()
0 commit comments