File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 90
90
# hardlinked from.
91
91
cdroot
92
92
temp_dir=" $( TMPDIR=" $( dirname " $input_file " ) " mktemp -d) "
93
- ln -P " $input_file " " $temp_dir /coder"
94
- ln -P Dockerfile " $temp_dir /"
93
+ ln_flags=" "
94
+
95
+ # -P is an illegal option on darwin and will cause script to fail.
96
+ if [[ $( uname | tr ' [:upper:]' ' [:lower:]' ) != ' darwin' ]]; then
97
+ ln_flags+=(-P)
98
+ fi
99
+
100
+ ln " ${ln_flags[@]} " " $input_file " " $temp_dir /coder"
101
+ ln " ${ln_flags[@]} " Dockerfile " $temp_dir /"
95
102
96
103
cd " $temp_dir "
97
104
Original file line number Diff line number Diff line change @@ -64,15 +64,21 @@ if [[ "$arch" == "arm" ]] || [[ "$arch" == "armv7" ]]; then
64
64
arch=" armhf"
65
65
fi
66
66
67
+ ln_flags=" "
68
+ # -P is an illegal option on darwin and will cause script to fail.
69
+ if [[ $( uname | tr ' [:upper:]' ' [:lower:]' ) != ' darwin' ]]; then
70
+ ln_flags+=(-P)
71
+ fi
72
+
67
73
# Make temporary dir where all source files intended to be in the package will
68
74
# be hardlinked from.
69
75
cdroot
70
76
temp_dir=" $( TMPDIR=" $( dirname " $input_file " ) " mktemp -d) "
71
- ln -P " $input_file " " $temp_dir /coder"
72
- ln -P " $( realpath coder.env) " " $temp_dir /"
73
- ln -P " $( realpath coder.service) " " $temp_dir /"
74
- ln -P " $( realpath preinstall.sh) " " $temp_dir /"
75
- ln -P " $( realpath scripts/nfpm.yaml) " " $temp_dir /"
77
+ ln " ${ln_flags[@]} " " $input_file " " $temp_dir /coder"
78
+ ln " ${ln_flags[@]} " " $( realpath coder.env) " " $temp_dir /"
79
+ ln " ${ln_flags[@]} " " $( realpath coder.service) " " $temp_dir /"
80
+ ln " ${ln_flags[@]} " " $( realpath preinstall.sh) " " $temp_dir /"
81
+ ln " ${ln_flags[@]} " " $( realpath scripts/nfpm.yaml) " " $temp_dir /"
76
82
77
83
cd " $temp_dir "
78
84
You can’t perform that action at this time.
0 commit comments