Skip to content

Commit 3284d23

Browse files
authored
Merge pull request #6 from devdotnetorg/dev
Dev => Master
2 parents ba852e1 + 70536a9 commit 3284d23

12 files changed

Lines changed: 147 additions & 68 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.3.1 (27-02-2023)
4+
5+
- Bugs fixed.
6+
37
## v0.3.0 (24-02-2023)
48

59
- Added support for using templates for projects, including custom ones.

CHANGELOG_ru.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.3.1 (27-02-2023)
4+
5+
- Исправлены ошибки.
6+
37
## v0.3.0 (24-02-2023)
48

59
- Добавлена поддержка использования шаблонов для проектов, включая пользовательские.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Devices supported: Raspberry Pi, Banana Pi, Orange Pi, Radxa, Tinkerboard, Odroi
1212

1313
*.NET FastIoT Extension UI*
1414

15-
![.NET FastIoT title](https://raw.githubusercontent.com/devdotnetorg/vscode-extension-dotnet-fastiot/dev/docs/vscode-dotnet-fastiot.png)
15+
![.NET FastIoT title](docs/vscode-dotnet-fastiot.png)
1616

17-
![.NET FastIoT interface](https://raw.githubusercontent.com/devdotnetorg/vscode-extension-dotnet-fastiot/dev/docs/vscode-dotnet-fastiot-interface.png)
17+
![.NET FastIoT interface](docs/vscode-dotnet-fastiot-interface.png)
1818

1919
## Features
2020

bashscript/installpackagemono.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# chmod +x installpackagemono.sh
44
# ./installpackagemono.sh
55

6+
#Page - https://www.mono-project.com/download/stable/#download-lin
7+
68
set -e #Exit immediately if a comman returns a non-zero status
79

810
echo "Run: installpackagemono.sh"

bashscript/uninstallpackagemono.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,14 @@ sudo apt-get purge -y mono-complete
1515
sudo apt-get autoremove -y --purge mono-complete
1616
#
1717

18+
#file exist $filename
19+
declare filename="/etc/apt/sources.list.d/mono-official-stable.list"
20+
21+
#removal
22+
if [ -f $filename ]; then
23+
#rm
24+
sudo rm $filename
25+
fi
26+
#
27+
1828
echo "Successfully"

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@
55
"icon": "assets/fastiot-logo-256.png",
66
"license": "LGPL-3.0-only",
77
"preview": true,
8-
"version": "0.3.0",
9-
"overview": "assets/marketplace/vscode-marketplace-overview.md",
10-
"priceCategory": "free",
8+
"version": "0.3.1",
119
"publisher": "devdotnetorg",
1210
"private": "false",
1311
"identity": {
1412
"internalName": "vscode-extension-dotnet-fastiot"
1513
},
14+
"categories": [
15+
"Programming Languages",
16+
"Other"
17+
],
1618
"keywords": [
1719
"dotnet",
1820
"C#",
1921
"IoT",
20-
"Board",
22+
"Linux",
23+
"Embedded",
2124
"Raspberry",
2225
"Remote",
23-
"Debugging",
24-
"SBC"
26+
"Debugging"
2527
],
2628
"engines": {
2729
"vscode": "^1.70.3"
@@ -35,10 +37,6 @@
3537
"url": "https://github.com/devdotnetorg/vscode-extension-dotnet-fastiot/issues",
3638
"email": "fastiot@devdotnet.org"
3739
},
38-
"categories": [
39-
"Programming Languages",
40-
"Other"
41-
],
4240
"activationEvents": [
4341
"onView:viewDevices",
4442
"onCommand:vscode-extension-dotnet-fastiot.helloWorld"

src/Entity/EntityBase.ts

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,17 @@ export abstract class EntityBase<T extends EntityBaseAttribute> {
7373
public Move(destDir:string):IotResult {
7474
let result:IotResult;
7575
try {
76-
//clear
77-
if (fs.existsSync(destDir)) fs.emptyDirSync(destDir);
78-
//mkdir
79-
IoTHelper.MakeDirSync(destDir);
76+
//delete
77+
if (fs.existsSync(destDir))
78+
{
79+
fs.emptyDirSync(destDir);
80+
fs.removeSync(destDir);
81+
}
82+
//destDir - no need to create a folder
8083
fs.moveSync(this.ParentDir,destDir);
8184
//replace fields
82-
this._descFilePath=`${destDir}\\${this.ParentNameDir}`;
85+
const fileName=this._descFilePath.substring(this.ParentDir.length+1);
86+
this._descFilePath= path.join(destDir, fileName);
8387
result = new IotResult(StatusResult.Ok,undefined,undefined);
8488
} catch (err: any){
8589
result = new IotResult(StatusResult.Error,`Unable to move ${this._entityIntLabel} from folder ${this.ParentDir} to folder ${destDir}`,err);
@@ -88,6 +92,23 @@ export abstract class EntityBase<T extends EntityBaseAttribute> {
8892
return result;
8993
}
9094

95+
public Remove ():IotResult {
96+
let result:IotResult;
97+
try {
98+
//delete
99+
if (fs.existsSync(this.ParentDir))
100+
{
101+
fs.emptyDirSync(this.ParentDir);
102+
fs.removeSync(this.ParentDir);
103+
}
104+
result = new IotResult(StatusResult.Ok,`Folder has been deleted: ${this.ParentDir}`);
105+
} catch (err: any){
106+
result = new IotResult(StatusResult.Error,`Unable to delete template folder: ${this.ParentDir}`,err);
107+
}
108+
//result
109+
return result;
110+
}
111+
91112
public Compare1(entityBase:EntityBase<T>):number{
92113
//0 - equal, 1 - entityBase up, -1 - entityBase down
93114
return this.Compare2(entityBase.Type,entityBase.Attributes.Version);

src/Entity/EntityDownloader.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export abstract class EntityDownloader {
2121
await networkHelper.DownloadFileHttp(item.Url,fileZipPath);
2222
//unpack
2323
let unpackPath=`${destPath}\\${item.Id}`;
24+
//delete
25+
if (fs.existsSync(unpackPath))
26+
{
27+
fs.emptyDirSync(unpackPath);
28+
fs.removeSync(unpackPath);
29+
}
2430
var AdmZip = require("adm-zip");
2531
var zip = new AdmZip(fileZipPath);
2632
// extracts everything

src/IotDevicePackage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,11 @@ export class IotDevicePackage extends BaseTreeItem {
198198
element = new IotDevicePackage(vscode.TreeItemCollapsibleState.None,this,this.Device);
199199
element.InitPackage(TypePackage.dotnetruntimes,undefined);
200200
this.Childs.push(element);
201+
/* Mono
201202
element = new IotDevicePackage(vscode.TreeItemCollapsibleState.None,this,this.Device);
202203
element.InitPackage(TypePackage.mono,undefined);
203204
this.Childs.push(element);
205+
*/
204206
element = new IotDevicePackage(vscode.TreeItemCollapsibleState.None,this,this.Device);
205207
element.InitPackage(TypePackage.debugger,undefined);
206208
this.Childs.push(element);

src/Templates/IotTemplate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export class IotTemplate extends EntityBase<IotTemplateAttribute> {
4646
let result = filesValidator.ValidateFiles(this.ParentDir,"template.files.schema.json");
4747
const validationErrors=<Array<string>>result.returnObject;
4848
this._validationErrors = validationErrors.slice();
49-
49+
//check id=""
50+
if (this.Attributes.Id=="") this._validationErrors.push("id cannot be empty");
5051
// TODO: проверка наличия файлов для dotnetapp.csproj которые внутри
5152
}
5253

@@ -144,12 +145,11 @@ export class IotTemplate extends EntityBase<IotTemplateAttribute> {
144145
this.Attributes.FileNameReplacement.forEach((value,key) => {
145146
const oldPath=dstPath+"\\"+IoTHelper.ReverseSeparatorLinuxToWin(key);
146147
value=IoTHelper.MergeWithDictionary(this._mergeDictionary,value);
148+
const newPath=dstPath+"\\"+IoTHelper.ReverseSeparatorLinuxToWin(value);
149+
fs.renameSync(oldPath,newPath);
147150
//replace in FilesToProcess
148151
let indexItem=this.Attributes.FilesToProcess.indexOf(key);
149152
if(indexItem>-1) this.Attributes.FilesToProcess[indexItem]=value;
150-
//
151-
const newPath=dstPath+"\\"+IoTHelper.ReverseSeparatorLinuxToWin(value);
152-
fs.renameSync(oldPath,newPath);
153153
//tracking the renaming of the main project file
154154
if(IoTHelper.GetFileExtensions(newPath)==this.Attributes.ExtMainFileProj)
155155
{

0 commit comments

Comments
 (0)