{"version":"2.1.242","anchor":"publishing-an-artifact-can-now-remove-files-from-it","canonical_anchor":"publishing-an-artifact-can-now-remove-files-from-it","heading":"Publishing an artifact can now remove files from it","tier":"use","area":"Artifacts","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.242\/e\/publishing-an-artifact-can-now-remove-files-from-it","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.242","markdown":"### Publishing an artifact can now remove files from it\n\nYou can remove files when publishing an artifact instead of re-listing everything you keep.\n\n**What**\n\nA publish can delete supporting files as well as add them, so an update no longer means re-listing everything you want to keep. Pass a `removeFiles` list of paths, or set a path to `null` in the map form of `files`, and those files are dropped from the artifact's next version while every file you left out stays published as it was.\n\n**Details**\n\n- The permission prompt counts the deletions as \"removing N file(s) from its current version\", and appends \"(its other published files stay)\" when only some of the artifact's files are going.\n- Removal is refused when the publish would create a new artifact rather than update an existing one, since there is nothing yet to remove from.\n- Removed names are resolved and checked to sit inside the artifact's `files\/` directory before being unlinked, and are recorded in the published `manifest.json` under a new `removed` key.\n- Publish arguments also accept `liveFiles`, new in this build; `files`, `removeFiles` and `liveFiles` each count as a content-bearing update on their own.\n- The local publishing stub used during development no longer wipes the whole `files` directory on each publish, so unlisted files persist instead of vanishing.\n- The defence against symlinks pointing outside the artifact now walks every parent directory up to the artifact root instead of checking only the immediate parent, and a file that fails the check is skipped and logged rather than aborting the whole publish.\n- If the account does not have multi-file publishing, the refusal now states plainly that nothing was published or removed and the artifact is unchanged.\n- Publish telemetry gained a count of removed files.\n\n**Evidence**\n\n`artifact stub: skipping removal of `, ``A `null` entry in `files` removes a file from an existing artifact``, `files left out of the map are kept and null removes that path`\n\n- Area: Artifacts\n- Names: `removeFiles`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5"}