File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,19 @@ int main(int argc, char *argv[]) {
160160 snprintf (destination_path , PATH_MAX , "%s" , entry .destination );
161161 deploy (source_path , destination_path , debug );
162162 } else if (command == CommandUndeploy ) {
163- if (unlink (entry .destination ) == -1 ) {
164- perror ("unlink" );
165- exit (1 );
163+ char source_path [PATH_MAX ];
164+ char destination_path [PATH_MAX ];
165+ snprintf (source_path , PATH_MAX , "%s" , entry .source );
166+ snprintf (destination_path , PATH_MAX , "%s" , entry .destination );
167+ if (destination_path [strlen (destination_path ) - 1 ] == '/' ) {
168+ destination_path [strlen (destination_path ) - 1 ] = '\0' ;
169+ }
170+ if (unlink (destination_path ) == -1 ) {
171+ if (errno != ENOENT ) {
172+ fprintf (stderr , "Failed to unlink \"%s\"\n" , destination_path );
173+ perror ("unlink" );
174+ exit (1 );
175+ }
166176 }
167177 }
168178 }
You can’t perform that action at this time.
0 commit comments