Ensure all patterns are replaces in debug init script

This commit is contained in:
Ivan Kravets
2021-06-24 16:00:13 +03:00
parent 2b94791387
commit 311e10f91e

View File

@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import os
from platformio import fs, proc, util
@ -238,4 +239,8 @@ class DebugConfigBase: # pylint: disable=too-many-instance-attributes
elif isinstance(value, (list, dict)) and recursive:
source[key] = self.reveal_patterns(value, patterns)
data = json.dumps(source)
if any(("$" + key) in data for key in patterns):
source = self.reveal_patterns(source, patterns)
return source