Skip to content

Commit

Permalink
Make sure output path exists.
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic committed Mar 3, 2021
1 parent 798e487 commit a3f1bc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rosidl_cli/rosidl_cli/command/generate/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import pathlib

from .extensions import load_type_extensions
Expand Down Expand Up @@ -81,6 +82,8 @@ def generate(

if output_path is None:
output_path = pathlib.Path.cwd()
else:
os.makedirs(output_path, exist_ok=True)

if len(extensions) > 1:
return [
Expand Down
2 changes: 2 additions & 0 deletions rosidl_cli/rosidl_cli/command/translate/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def translate(

if output_path is None:
output_path = pathlib.Path.cwd()
else:
os.makedirs(output_path, exist_ok=True)

translated_interface_files = []
for input_format, interface_files in interface_files_per_format.items():
Expand Down

0 comments on commit a3f1bc3

Please sign in to comment.