-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
P1-highHigh priorityHigh priorityarea/cross-platformCross-platform support (macOS, Windows, Linux)Cross-platform support (macOS, Windows, Linux)bugSomething isn't workingSomething isn't working
Description
Overview
File: `lib/src/cli/utils/template_manifest.dart` lines 99-113
`computeFileHash()` shells out to `shasum` (macOS) then falls back to `sha256sum` (Linux). Neither command exists on Windows. The function silently returns an empty string on Windows.
Impact
On Windows:
- Template version tracking hash is always `''`
- `templateHash == installedHash` becomes `'' == ''` → always true
- Templates never get updated after initial installation (stuck on first version)
- OR all templates always show as "changed" depending on the comparison direction
Fix
Use Dart's `package:crypto` (already a transitive dependency) instead of shelling out:
import 'package:crypto/crypto.dart';
import 'dart:convert';
String computeFileHash(File file) {
if (!file.existsSync()) return '';
final bytes = file.readAsBytesSync();
return sha256.convert(bytes).toString();
}This is simpler, faster, and works on all platforms.
Acceptance Criteria
- `computeFileHash` uses pure Dart crypto, no shell commands
- Works on macOS, Linux, and Windows
- Test added verifying hash computation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1-highHigh priorityHigh priorityarea/cross-platformCross-platform support (macOS, Windows, Linux)Cross-platform support (macOS, Windows, Linux)bugSomething isn't workingSomething isn't working