Skip to content

Commit 2e079e2

Browse files
committed
Fix import
1 parent 7cc86a8 commit 2e079e2

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

node_cli/configs/node_options.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# This file is part of node-cli
4+
#
5+
# Copyright (C) 2022 SKALE Labs
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU Affero General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU Affero General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Affero General Public License
18+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
20+
import os
21+
from node_cli.configs import NODE_DATA_PATH
22+
23+
NODE_OPTIONS_FILEPATH = os.path.join(NODE_DATA_PATH, 'node_options.json')

node_cli/utils/helper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ def write_json(path, content):
8181
json.dump(content, outfile, indent=4)
8282

8383

84+
def init_file(path, content=None):
85+
if not os.path.exists(path):
86+
write_json(path, content)
87+
88+
8489
def run_cmd(
8590
cmd,
8691
env={},

0 commit comments

Comments
 (0)