@putout/operator-filesystem 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/filesystem.js CHANGED
@@ -153,6 +153,13 @@ module.exports.writeFileContent = (filePath, content) => {
153
153
 
154
154
  maybeFS.writeFileContent(filename, content);
155
155
 
156
+ const contentPath = getProperty(filePath, 'content');
157
+
158
+ if (contentPath) {
159
+ contentPath.node.value.value = content;
160
+ return;
161
+ }
162
+
156
163
  filePath.node.properties.push(ObjectProperty(StringLiteral('content'), StringLiteral(content)));
157
164
  };
158
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/operator-filesystem",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout operator adds ability to filesystem referenced variables that was not defined",