Improving command line wrapper.

This commit is contained in:
Ruidajo 2022-01-28 21:52:55 -05:00
parent 60b1c447b1
commit cf919bdaf6
1 changed files with 81 additions and 0 deletions

View File

@ -43,6 +43,18 @@ FossilRepo class >> locateExecutable [
^ outString allButLast ]
]
{ #category : #operation }
FossilRepo >> add2: aFileRealitvePath [
OSSUnixSubprocess new
command: 'fossil';
arguments: { 'add' . aFileRealitvePath };
workingDirectory: self localFolderName2;
redirectStdout;
redirectStderr;
runAndWaitOnExitDo: [ :process :outString | ^ outString ]
]
{ #category : #operation }
FossilRepo >> add: fileRelativePath [
"I add a file to the working Fossil repository, given that both, the file and the repositor,
@ -85,6 +97,18 @@ FossilRepo >> checkinsFor: relativeFilePath [
^ payload at: 'checkins'
]
{ #category : #accessing }
FossilRepo >> command: aCommandArgument [
OSSUnixSubprocess new
command: 'fossil';
arguments: { aCommandArgument };
workingDirectory: self localFolderName2;
redirectStdout;
redirectStderr;
runAndWaitOnExitDo: [ :process :outString | ^ outString ]
]
{ #category : #operation }
FossilRepo >> commit: message [
"I add a file to the working Fossil repository, given that both, the file and the repositor,
@ -124,11 +148,30 @@ FossilRepo >> createPage: pageName [
^ NeoJSONReader fromString: (self jsonWikiDataFor: 'create/', pageName)
]
{ #category : #accessing }
FossilRepo >> extra [
^ self command: 'extra'
]
{ #category : #wiki }
FossilRepo >> fetchPage: pageName [
^ NeoJSONReader fromString: (self jsonWikiDataFor: 'get/', pageName)
]
{ #category : #accessing }
FossilRepo >> fossilUv: anArgument arg2: aSecondArgument [
OSSUnixSubprocess new
command: 'fossil';
arguments: { 'uv' . anArgument . aSecondArgument };
workingDirectory: self localFolderName2;
redirectStdout;
redirectStderr;
runAndWaitOnExitDo: [ :process :outString | ^ outString ]
]
{ #category : #'as yet unclassified' }
FossilRepo >> getFileContentsFor: anEmbeddedDocUrl [
"Given the web page contents for a file, hosted in Fossil, I detect all the standard
@ -237,6 +280,12 @@ FossilRepo >> localFolderName [
^ self local parent fullName
]
{ #category : #accessing }
FossilRepo >> localFolderName2 [
^ self local fullName
]
{ #category : #authentication }
FossilRepo >> loginAs: anUserName withPassword: password [
| jsonData |
@ -296,6 +345,38 @@ FossilRepo >> status [
runAndWaitOnExitDo: [ :process :outString | ^ outString ]
]
{ #category : #accessing }
FossilRepo >> status2 [
^ self command: 'status'.
]
{ #category : #accessing }
FossilRepo >> update [
OSSUnixSubprocess new
command: 'fossil';
arguments: #('update');
workingDirectory: self localFolderName2;
redirectStdout;
redirectStderr;
runAndWaitOnExitDo: [ :process :outString | ^ outString ]
]
{ #category : #accessing }
FossilRepo >> uvAdd: aFileRelativePath [
^ self fossilUv: 'add' arg2: aFileRelativePath
]
{ #category : #accessing }
FossilRepo >> uvSync [
^ self fossilUv: 'sync' arg2: '-v'
]
{ #category : #authentication }
FossilRepo >> whoAmI [
^ NeoJSONReader fromString: (self jsonDataFor: 'whoami')