Skip to content

Commit e4c92a9

Browse files
committed
fix: make execubale
1 parent 1f87ed9 commit e4c92a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ async function run() {
4848
const installedPath = await installFlutterGen(version, cacheEnabled, cacheKey, cachePath);
4949
info(`FlutterGen installed: ${installedPath}`);
5050

51+
await makeExecutable(join(installedPath, 'fluttergen'));
52+
5153
await execa('fluttergen', ['--version'], { stdio: 'inherit' });
5254

5355
setOutput('version', version);
@@ -96,7 +98,6 @@ async function installFlutterGen(
9698
const hitCacheKey = await restoreCache([cachePath], cacheKey);
9799
if (hitCacheKey) {
98100
info(`Restored FlutterGen from cache: ${cachePath}`);
99-
addPath(cachePath);
100101
return cachePath;
101102
}
102103
}
@@ -125,7 +126,6 @@ async function installFlutterGen(
125126
const downloadPath = await downloadTool(downloadUrl);
126127

127128
const extractDir = await extractTar(downloadPath, cachePath);
128-
addPath(extractDir);
129129

130130
if (cacheEnabled) {
131131
await saveCache([extractDir], cacheKey);
@@ -135,4 +135,9 @@ async function installFlutterGen(
135135
return extractDir;
136136
}
137137

138+
async function makeExecutable(fluttergenPath: string): Promise<void> {
139+
await execa('chmod', ['+x', fluttergenPath]);
140+
addPath(fluttergenPath);
141+
}
142+
138143
run();

0 commit comments

Comments
 (0)