Skip to content

Commit

Permalink
Use isFile/isDirectory instead of exists
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Oct 10, 2024
1 parent 238bc38 commit 6a8fe59
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ asset-creation
loadAssetFileFrom: aFileSystem
| reference |
reference := aFileSystem referenceTo: self path.
reference exists ifFalse: [^ nil].
reference isFile ifFalse: [^ nil].
^ reference readStreamDo: [:stream |
(self canReadAssetFrom: stream) ifFalse: [^ nil].
GSAssetFile withMapper: self fromStream: stream]
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"initialize" : "mad 9/20/2023 18:55",
"isValidAsset:" : "mad 9/29/2024 17:39",
"kind" : "mad 9/29/2024 19:28",
"loadAssetFileFrom:" : "mad 10/9/2024 16:01",
"loadAssetFileFrom:" : "mad 10/9/2024 23:11",
"loadAssetFileFromImage:" : "mad 9/29/2024 16:35",
"loadAssetFromImage:" : "mad 9/29/2024 17:42",
"mappedPathPatterns" : "mad 10/9/2024 16:01",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
moving
requestNewRepositoryLocation
| start |
start := GSPathUtilities ancestorThatExists: self fsReference.
start := GSPathUtilities ancestorOf: self fsReference that: #isDirectory.
start := FileDirectory on: start printString.
^ (UIManager default
chooseDirectory: 'New repository location:'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"requestAndMoveToNewRepositoryLocation" : "mad 12/22/2023 17:49",
"requestAndRememberRemoteNameAndRefFor:" : "mad 12/13/2023 19:00",
"requestCredentialsFor:ifCanceled:" : "mad 9/18/2023 12:49",
"requestNewRepositoryLocation" : "mad 10/9/2024 16:01",
"requestNewRepositoryLocation" : "mad 10/9/2024 23:14",
"requestRemoteNameAndRefFor:" : "mad 12/13/2023 18:59",
"serializeChangeSets:onCommit:" : "mad 10/2/2024 18:35",
"setUpstreamRemoteName:andRef:for:" : "mad 12/13/2023 18:28",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
testing
hasAnyFile: aFileSystem
^ (self fixedLegacyReferencesIn: aFileSystem) anySatisfy: #exists
^ (self fixedLegacyReferencesIn: aFileSystem) anySatisfy: #isFile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
metadata-loading-legacy
loadLegacySerializerNameFromSquotContentsReference: aReference
| metadata |
aReference exists ifFalse: [^ nil].
aReference isFile ifFalse: [^ nil].
metadata := aReference readStreamDo: [:stream | self stonFromStream: stream].
^ (metadata at: #serializer ifAbsent: [^ nil]) asSymbol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ metadata-loading-legacy
loadLegacySquotContentsReferencesAndSerializersFromLegacySquotFileIn: aFileSystem
| reference loadOrder |
reference := self legacySquotReferenceIn: aFileSystem.
reference exists ifFalse: [^ nil].
reference isFile ifFalse: [^ nil].
loadOrder := reference readStreamDo: [:stream | self stonFromStream: stream].
^ loadOrder associations collect: [:pathToSerializer | | path |
path := (GSPathUtilities fromString: pathToSerializer key) / self legacySquotContentsFileBaseName.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ metadata-loading-legacy
loadMappersFromLegacySquotMaterializeFileIn: aFileSystem
| reference |
reference := self legacySquotMaterializeReferenceIn: aFileSystem.
reference exists ifFalse: [^ nil].
reference isFile ifFalse: [^ nil].
^ reference readStreamDo: [:stream | self stonFromStream: stream]
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ metadata-loading
loadMetadataFileFromFileSystem: aFileSystem
| reference |
reference := {self metadataReferenceIn: aFileSystem. self legacySquotMetadataReferenceIn: aFileSystem}
detect: #exists ifNone: [^ nil].
detect: #isFile ifNone: [^ nil].
^ reference readStreamDo: [:stream | self stonFromStream: stream]
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ loadMetadatasWithUntrackedMappersFromFSCommits: aCollection in: aWorkingCopy
withMappedPathPatterns: mappedPathPatterns) ifTrue: [
fileSystems with: untrackedMappers do: [:fileSystem :mappers | | reference |
reference := fileSystem referenceTo: path.
reference exists ifTrue: [mappers add: (self untrackedMapperForReference: reference)]]]]
reference isFile ifTrue: [mappers add: (self untrackedMapperForReference: reference)]]]]
displayingProgress: [:path | 'Scanning for potential changes in untracked file {1}' format: {GSPathUtilities asString: path}].
^ metadatas with: untrackedMappers collect: [:metadata :mappers | metadata withAddedMappers: mappers]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"changeSetsFromMetadata:toMetadata:old:common:new:in:" : "mad 10/7/2024 17:31",
"changeSetsToMergeFSCommit:into:withBase:in:" : "mad 10/7/2024 17:31",
"fixedLegacyReferencesIn:" : "mad 10/9/2024 18:02",
"hasAnyFile:" : "mad 10/9/2024 17:17",
"hasAnyFile:" : "mad 10/9/2024 23:12",
"legacyReferencesIn:" : "mad 10/9/2024 18:02",
"legacySquotClassMapping:" : "mad 10/9/2024 17:51",
"legacySquotClassMappings" : "mad 10/9/2024 17:50",
Expand All @@ -37,18 +37,18 @@
"legacySquotReferenceIn:" : "mad 10/9/2024 17:18",
"loadFallbackMappersFromFileSystem:" : "mad 10/9/2024 17:10",
"loadFallbackMetadataFromFileSystem:in:" : "mad 8/27/2024 21:08",
"loadLegacySerializerNameFromSquotContentsReference:" : "mad 10/9/2024 17:40",
"loadLegacySquotContentsReferencesAndSerializersFromLegacySquotFileIn:" : "mad 10/9/2024 17:40",
"loadLegacySerializerNameFromSquotContentsReference:" : "mad 10/9/2024 23:12",
"loadLegacySquotContentsReferencesAndSerializersFromLegacySquotFileIn:" : "mad 10/9/2024 23:12",
"loadLegacySquotContentsReferencesIn:" : "mad 10/9/2024 17:12",
"loadMapperFromLegacySquotContentsReference:fallbackSerializer:" : "mad 10/9/2024 16:01",
"loadMappersFromFileSystem:" : "mad 8/24/2024 17:06",
"loadMappersFromLegacySquotFileIn:" : "mad 10/9/2024 17:12",
"loadMappersFromLegacySquotMaterializeFileIn:" : "mad 10/9/2024 17:38",
"loadMetadataFileFromFileSystem:" : "mad 10/9/2024 17:41",
"loadMappersFromLegacySquotMaterializeFileIn:" : "mad 10/9/2024 23:13",
"loadMetadataFileFromFileSystem:" : "mad 10/9/2024 23:13",
"loadMetadataFromFSCommit:in:" : "mad 6/12/2024 13:59",
"loadMetadataFromFileSystem:in:" : "mad 8/24/2024 17:04",
"loadMetadataFromWorkingCopy:" : "mad 6/11/2024 18:37",
"loadMetadatasWithUntrackedMappersFromFSCommits:in:" : "mad 10/9/2024 16:01",
"loadMetadatasWithUntrackedMappersFromFSCommits:in:" : "mad 10/9/2024 23:13",
"mappedPathPatterns" : "mad 10/9/2024 17:23",
"metadataFilePath" : "mad 10/9/2024 17:13",
"metadataReferenceIn:" : "mad 10/9/2024 17:18",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"class" : {
"ancestorOf:that:" : "mad 12/22/2023 18:08",
"ancestorThatExists:" : "mad 12/22/2023 18:12",
"asRelativeString:" : "mad 8/13/2024 17:56",
"asString:" : "mad 11/21/2023 15:02",
"commonPrefixOf:and:" : "mad 10/9/2024 16:01",
Expand Down

0 comments on commit 6a8fe59

Please sign in to comment.