{"id":13772492,"url":"https://github.com/jecisc/SystemInteraction","last_synced_at":"2025-05-11T04:31:29.968Z","repository":{"id":44476613,"uuid":"246272301","full_name":"jecisc/SystemInteraction","owner":"jecisc","description":"I am a project to simplify system interactions in Pharo","archived":false,"fork":false,"pushed_at":"2022-07-11T12:53:07.000Z","size":683,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T00:25:48.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jecisc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-10T10:32:31.000Z","updated_at":"2022-10-09T01:19:12.000Z","dependencies_parsed_at":"2022-08-19T16:10:12.956Z","dependency_job_id":null,"html_url":"https://github.com/jecisc/SystemInteraction","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSystemInteraction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSystemInteraction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSystemInteraction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSystemInteraction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jecisc","download_url":"https://codeload.github.com/jecisc/SystemInteraction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518941,"owners_count":21921074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:04.634Z","updated_at":"2025-05-11T04:31:25.826Z","avatar_url":"https://github.com/jecisc.png","language":"Smalltalk","funding_links":[],"categories":["System interaction"],"sub_categories":[],"readme":"# SystemInteraction\n\nI provide a homogeneous api to execute OS commands or scripts. The api is the same for any of Windows, Linux, Mac operating systems in Pharo.\n\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [Version management](#version-management)\n- [Smalltalk versions compatibility](#smalltalk-versions-compatibility)\n- [Contact](#contact)\n\n## Installation\n\nTo install the project in your Pharo image execute:\n\n```Smalltalk\n    Metacello new\n    \tgithubUser: 'jecisc' project: 'SystemInteraction' commitish: 'v1.x.x' path: 'src';\n    \tbaseline: 'SystemInteraction';\n    \tload\n```\n\nTo add it to your baseline:\n\n```Smalltalk\n    spec\n    \tbaseline: 'SystemInteraction'\n    \twith: [ spec repository: 'github://jecisc/SystemInteraction:v1.x.x/src' ]\n```\n\nNote that you can replace the #v1.x.x by another branch such as #development or a tag such as #v1.0.0, #v1.? or #v1.1.?.\n\n\n## Documentation\n\nWith this project it is possible to launch commands in different ways.\n\n### Blocking commands\n\nIf you want a blocking command returning the result of the command:\n\n```Smalltalk\nSICommand waitForCommand: 'ls'\n```\n\nYou can add arguments:\n\n```Smalltalk\nSICommand waitForCommand: 'ls' arguments: { '-h'. '-l' }\n```\n\nYou can also want you command to be a blocking command but to not care about the stdout of the command:\n\n```Smalltalk\nSICommand waitForCommand: 'ls' silently: true.\nSICommand waitForCommand: 'ls' arguments: { '-h'. '-l' } silently: true\n```\n\n### Non blocking commands\n\nIf you want a non blocking command:\n\n```Smalltalk\nSICommand executeCommand: 'open'\n```\n\nYou can add arguments:\n\n```Smalltalk\nSICommand waitForCommand: 'mkdir' arguments: { 'testDir' }\n```\n\n### Execute a script\n\nIt is possible to execute a script in two ways:\n- If you have a file, you can execute it via `SICommand class\u003e\u003e#executeScriptFile:silently:`\n- If you just have the script in the form of a text, you can execute it via `SICommand class\u003e\u003e#executeScript:silently:`\n\n### Utilities\n\nThis project also contains some utilities such has:\n- Copying a folder to another using a system command\n- Deleting a folder using a system command\n- Unzipping a zip archive\n- Creating a zip archive\n\n```Smalltalk\ndir := 'testDir' asFileReference.\ndir ensureCreateDirectory.\n\n(dir / 'test1.txt') ensureCreateFile.\n(dir / 'test2.txt') ensureCreateFile.\n(dir / 'test3.txt') ensureCreateFile.\n(dir / 'test4.txt') ensureCreateFile.\n\ndir2 := 'destination' asFileReference.\ndir2 ensureCreateDirectory.\n\nSICommand default copyAll: dir to: dir2.\n\nSICommand default deleteAll: dir.\nSICommand default deleteAll: dir2.\n\n\nZnClient new\n\turl: 'https://github.com/jecisc/SystemInteraction/archive/master.zip';\n\tdownloadTo: 'master.zip'.\n\t\n\nzip := 'master.zip' asFileReference.\nunzipped := 'unzipDest' asFileReference.\n\nSICommand default unzip: zip asFileReference to: unzipped.\n\nSICommand default zip: { unzipped } to: 'testArchive.zip'.\n\n\nSICommand default deleteAll: zip.\nSICommand default deleteAll: unzipped.\nSICommand default deleteAll: 'testArchive.zip'.\n```\n\nMore might comes in the future.\n\n## Version management \n\nThis project use semantic versioning to define the releases. This means that each stable release of the project will be assigned a version number of the form `vX.Y.Z`. \n\n- **X** defines the major version number\n- **Y** defines the minor version number \n- **Z** defines the patch version number\n\nWhen a release contains only bug fixes, the patch number increases. When the release contains new features that are backward compatible, the minor version increases. When the release contains breaking changes, the major version increases. \n\nThus, it should be safe to depend on a fixed major version and moving minor version of this project.\n\n## Smalltalk versions compatibility\n\n| Version \t| Compatible Pharo versions \t\t|\n|-------------\t|---------------------------\t|\n| 1.x.x       \t| Pharo 61, 70, 80, 90, 10\t\t\t\t|\n\n## Contact\n\nIf you have any questions or problems do not hesitate to open an issue or contact cyril (a) ferlicot.me \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjecisc%2FSystemInteraction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjecisc%2FSystemInteraction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjecisc%2FSystemInteraction/lists"}