Skip to content

Commit

Permalink
Comitted workflow to move files
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Mar 8, 2024
1 parent 366f97d commit f6e06d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ runs:
- name: Build Version
run: dart run build_runner build --delete-conflicting-outputs
shell: bash

- name: Move public install scripts
run: dart run grinder move-scripts
shell: bash
21 changes: 21 additions & 0 deletions tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,27 @@ void testSetup() {
runDartScript('bin/main.dart', arguments: ['install', 'stable']);
}

@Task('Move install.sh and uninstall.sh to public directory')
void moveScripts() {
final installScript = File('scripts/install.sh');
final uninstallScript = File('scripts/uninstall.sh');

if (!installScript.existsSync() || !uninstallScript.existsSync()) {
throw Exception('Install or uninstall script does not exist');
}

final publicDir = Directory('docs/public');

if (!publicDir.existsSync()) {
throw Exception('Public directory does not exist');
}

installScript.copySync(path.join(publicDir.path, 'install.sh'));
uninstallScript.copySync(path.join(publicDir.path, 'uninstall.sh'));

print('Moved install.sh and uninstall.sh to public directory');
}

@Task('Run tests')
@Depends(testSetup)
Future<void> test() async {
Expand Down

0 comments on commit f6e06d8

Please sign in to comment.