Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c3c1587

Browse files
committedApr 8, 2024
Fix exec in docker
1 parent e98f227 commit c3c1587

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed
 

‎tools/config_editor/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def main() -> None:
265265
print("Warning: Default Arduino path not found. Disabling copy to Arduino.")
266266
app.setting_enable_copy = False
267267
elif args.arduino_path == "/arduino-esp32": # Docker mount point
268-
print("Error: Arduino folder not mounted to /arduino-esp32 in Docker container.")
269-
exit(1)
268+
print("Warning: Docker mount point not found. Disabling copy to Arduino.")
269+
app.setting_enable_copy = False
270270
else:
271271
print("Error: Invalid path to Arduino core: " + os.path.abspath(args.arduino_path))
272272
exit(1)

‎tools/config_editor/compile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,13 @@ def compile_libs(self) -> None:
139139
print("Error reading child process errors: " + str(e))
140140
label.update("Compilation failed for " + target)
141141
else:
142-
regex = r"^[1-9][0-9]*:[1-9][0-9]*$" # Regex to match the line:column format
142+
regex = r"^[1-9][0-9]*:[1-9][0-9]*$" # Regex to match the uid:gid format
143143
if self.app.setting_arduino_permissions and re.match(regex, self.app.setting_arduino_permissions):
144+
print_info("Changing permissions of generated files")
144145
chown_process = None
145146
try:
146147
chown_process = subprocess.run(["chown", "-R", self.app.setting_arduino_permissions, self.app.setting_arduino_path])
148+
chown_process.wait()
147149
except Exception as e:
148150
print("Error changing permissions: " + str(e))
149151

‎tools/docker/entrypoint.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ then
1515
done
1616
fi
1717

18-
exec "$@"
19-
20-
if [ -d /arduino-esp32 ]; then
21-
echo "Fixing permissions on /arduino-esp32"
22-
chown -R `stat -c "%u:%g" /arduino-esp32` /arduino-esp32
18+
# Check if /arduino-esp32 exists
19+
if [ -d "/arduino-esp32" ]; then
20+
# If it exists, add the -p argument
21+
exec "$@" -p `stat -c "%u:%g" /arduino-esp32`
22+
else
23+
# If it doesn't exist, just execute the command without the -p argument
24+
exec "$@"
2325
fi

0 commit comments

Comments
 (0)
Please sign in to comment.