Skip to content

Commit

Permalink
removed some spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Jul 27, 2024
1 parent 557862f commit f00a203
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/app/shared/system-service/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export class FileService{
return this._directoryFileEntires;
}

public async getFilesPathsFromDirectoryAsync(dirPath:string):Promise<string[]>{
public async getEntriesFromDirectoryAsync(dirPath:string):Promise<string[]>{
await this.initBrowserFsAsync();

return new Promise<string[]>((resolve, reject) => {
Expand Down
10 changes: 5 additions & 5 deletions src/app/system-apps/fileexplorer/fileexplorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
private _processIdService:ProcessIDService;
private _runningProcessService:RunningProcessService;
private _fileService:FileService;
private _directoryFilesEntires!:FileEntry[];
private _directoryFilesEntries!:FileEntry[];
private _triggerProcessService:TriggerProcessService;
private _stateManagmentService: StateManagmentService;
private _sessionManagmentService: SessionManagmentService;
Expand Down Expand Up @@ -626,11 +626,11 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
private async loadFilesInfoAsync():Promise<void>{
this.files = [];
this._fileService.resetDirectoryFiles();
const dirFileEntries = await this._fileService.getFilesPathsFromDirectoryAsync(this.directory);
this._directoryFilesEntires = this._fileService.getFileEntriesFromDirectory(dirFileEntries,this.directory);
const directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(this.directory);
this._directoryFilesEntries = this._fileService.getFileEntriesFromDirectory(directoryEntries,this.directory);

for(let i = 0; i < dirFileEntries.length; i++){
const fileEntry = this._directoryFilesEntires[i];
for(let i = 0; i < directoryEntries.length; i++){
const fileEntry = this._directoryFilesEntries[i];
const fileInfo = await this._fileService.getFileInfoAsync(fileEntry.getPath);

this.files.push(fileInfo)
Expand Down
10 changes: 5 additions & 5 deletions src/app/system-apps/filemanager/filemanager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class FileManagerComponent implements BaseComponent, OnInit, AfterViewIni
private _processIdService:ProcessIDService;
private _runningProcessService:RunningProcessService;
private _fileService:FileService;
private _directoryFilesEntires!:FileEntry[];
private _directoryFilesEntries!:FileEntry[];
private _triggerProcessService:TriggerProcessService;
private _menuService:MenuService;
private _formBuilder;
Expand Down Expand Up @@ -153,11 +153,11 @@ export class FileManagerComponent implements BaseComponent, OnInit, AfterViewIni
private async loadFilesInfoAsync():Promise<void>{
this.files = [];
this._fileService.resetDirectoryFiles();
const dirFileEntries = await this._fileService.getFilesPathsFromDirectoryAsync(this.directory);
this._directoryFilesEntires = this._fileService.getFileEntriesFromDirectory(dirFileEntries,this.directory);
const directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(this.directory);
this._directoryFilesEntries = this._fileService.getFileEntriesFromDirectory(directoryEntries,this.directory);

for(let i = 0; i < dirFileEntries.length; i++){
const fileEntry = this._directoryFilesEntires[i];
for(let i = 0; i < directoryEntries.length; i++){
const fileEntry = this._directoryFilesEntries[i];
const fileInfo = await this._fileService.getFileInfoAsync(fileEntry.getPath);

this.files.push(fileInfo)
Expand Down
8 changes: 4 additions & 4 deletions src/app/system-apps/photoviewer/photoviewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ export class PhotoViewerComponent implements BaseComponent, OnInit, OnDestroy, A
// else, go fetch.
const dirPath = dirname(this.picSrc);
//console.log('dirPath:', dirPath);
const pathList:string[] = await this._fileService.getFilesPathsFromDirectoryAsync(dirPath);
const entries:string[] = await this._fileService.getEntriesFromDirectoryAsync(dirPath);

//check for images
for(let i = 0; i <= pathList.length - 1; i++){
if(this._consts.IMAGE_FILE_EXTENSIONS.includes(extname(pathList[i]))){
this.imageList.push(`${dirPath}/${pathList[i]}`);
for(let i = 0; i <= entries.length - 1; i++){
if(this._consts.IMAGE_FILE_EXTENSIONS.includes(extname(entries[i]))){
this.imageList.push(`${dirPath}/${entries[i]}`);
}
}
}
Expand Down
29 changes: 13 additions & 16 deletions src/app/system-apps/terminal/terminal.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class TerminalCommands{
private _triggerProcessService:TriggerProcessService;
private _runningProcessService:RunningProcessService;
private _fileService:FileService;
private _directoryFilesEntires!:FileEntry[];
private _directoryFilesEntries!:FileEntry[];
private _appDirctory = new AppDirectory();

private permissionChart!:Map<number, OctalRepresentation>;
Expand Down Expand Up @@ -605,17 +605,17 @@ Mandatory argument to long options are mandotory for short options too.
const folderName = this.getFileName(sourcePath);
const createFolderResult = await this._fileService.createFolderAsync(destinationArg, folderName);
if(createFolderResult){
const loadedFilePaths = await this._fileService.getFilesPathsFromDirectoryAsync(sourcePath);
for(const filePath of loadedFilePaths){
const checkIfDirResult = await this._fileService.checkIfDirectory(filePath);
const loadedDirectoryEntries = await this._fileService.getEntriesFromDirectoryAsync(sourcePath);
for(const directoryEntry of loadedDirectoryEntries){
const checkIfDirResult = await this._fileService.checkIfDirectory(`${sourcePath}/${directoryEntry}`);
if(checkIfDirResult){
folderQueue.push(filePath);
folderQueue.push(`${sourcePath}/${directoryEntry}`);
}else{
const result = await this._fileService.copyFileAsync(filePath, `${destinationArg}/${folderName}`);
const result = await this._fileService.copyFileAsync(`${sourcePath}/${directoryEntry}`, `${destinationArg}/${folderName}`);
if(result){
console.log(`file:${filePath} successfully copied to destination:${destinationArg}/${folderName}`);
console.log(`file:${sourcePath}/${directoryEntry} successfully copied to destination:${destinationArg}/${folderName}`);
}else{
console.log(`file:${filePath} failed to copy to destination:${destinationArg}/${folderName}`)
console.log(`file:${sourcePath}/${directoryEntry} failed to copy to destination:${destinationArg}/${folderName}`)
}
}
}
Expand All @@ -627,12 +627,10 @@ Mandatory argument to long options are mandotory for short options too.
return this.cp_dir_handler(arg0,`${destinationArg}/${folderName}`, folderQueue);
}


private getFileName(path:string):string{
return `${basename(path, extname(path))}${ extname(path)}`;
}


private sendDirectoryUpdateNotification():void{
if(this.currentDirectoryPath.includes('/osdrive/Desktop')){
this._fileService.addEventOriginator('filemanager');
Expand All @@ -645,15 +643,14 @@ Mandatory argument to long options are mandotory for short options too.
private async loadFilesInfoAsync(directory:string):Promise<void>{
this.files = [];
this._fileService.resetDirectoryFiles();
const dirFileEntries = await this._fileService.getFilesPathsFromDirectoryAsync(directory);
this._directoryFilesEntires = this._fileService.getFileEntriesFromDirectory(dirFileEntries,directory);
const directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(directory);
this._directoryFilesEntries = this._fileService.getFileEntriesFromDirectory(directoryEntries,directory);

for(let i = 0; i < dirFileEntries.length; i++){
const fileEntry = this._directoryFilesEntires[i];
for(let i = 0; i < directoryEntries.length; i++){
const fileEntry = this._directoryFilesEntries[i];
const fileInfo = await this._fileService.getFileInfoAsync(fileEntry.getPath);

this.files.push(fileInfo)
}
}

}
}

0 comments on commit f00a203

Please sign in to comment.