particle-commands 0.5.1 → 0.5.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
4
4
  and this project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ### 0.5.2 - 2023-10-17
7
+ - Fix asset ota key in project properties file
8
+
6
9
  ### 0.5.1 - 2023-10-11
7
10
  - Fix gitignore file
8
11
 
@@ -123,17 +123,24 @@ var ProjectProperties = function () {
123
123
  }, {
124
124
  key: 'writeAssetOtaDir',
125
125
  value: function writeAssetOtaDir() {
126
- // Add a commented line for assetOtaDir
127
- var data = '#assetOtaDir=assets\n';
128
- return this.fs.appendFile(this.name(), data, 'utf8');
126
+ var _this3 = this;
127
+
128
+ // // Add a commented line for assetOtaDir if it doesn't exist
129
+ this.load().then(function () {
130
+ var val = _this3.getField('#assetOtaDir');
131
+ if (!val) {
132
+ _this3.setField('#assetOtaDir', 'assets');
133
+ return _this3.save();
134
+ }
135
+ });
129
136
  }
130
137
  }, {
131
138
  key: 'serialize',
132
139
  value: function serialize() {
133
- var _this3 = this;
140
+ var _this4 = this;
134
141
 
135
142
  return Object.keys(this.fields).map(function (field) {
136
- return field + '=' + _this3.fields[field];
143
+ return field + '=' + _this4.fields[field];
137
144
  }).join('\n') + '\n';
138
145
  }
139
146
  }, {
@@ -162,11 +169,11 @@ var ProjectProperties = function () {
162
169
  }, {
163
170
  key: 'projectLayout',
164
171
  value: function projectLayout() {
165
- var _this4 = this;
172
+ var _this5 = this;
166
173
 
167
174
  return this.exists().then(function (exists) {
168
175
  if (exists) {
169
- return _this4.sourceDirExists().then(function (exists) {
176
+ return _this5.sourceDirExists().then(function (exists) {
170
177
  return exists ? extended : simple;
171
178
  });
172
179
  } else {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "particle-commands",
3
3
  "description": "Library of UX-neutral commands that provide key functionality for developer tools",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "author": "Matthew McGowan",
6
6
  "bugs": {
7
7
  "url": "https://github.com/particle-iot/particle-commands/issues"
@@ -73,9 +73,15 @@ export default class ProjectProperties {
73
73
  }
74
74
 
75
75
  writeAssetOtaDir() {
76
- // Add a commented line for assetOtaDir
77
- const data = '#assetOtaDir=assets\n';
78
- return this.fs.appendFile(this.name(), data, 'utf8');
76
+ // // Add a commented line for assetOtaDir if it doesn't exist
77
+ this.load()
78
+ .then(() => {
79
+ const val = this.getField('#assetOtaDir');
80
+ if (!val) {
81
+ this.setField('#assetOtaDir', 'assets');
82
+ return this.save();
83
+ }
84
+ });
79
85
  }
80
86
 
81
87
  serialize() {