diff --git a/script/post-install.ts b/script/post-install.ts
index 31b224a06c9..f82729484c9 100644
--- a/script/post-install.ts
+++ b/script/post-install.ts
@@ -53,7 +53,7 @@ findYarnVersion(path => {
     process.exit(result.status || 1)
   }
 
-  if (isOffline()) {
+  if (!isOffline()) {
     result = spawnSync(
       'git',
       ['submodule', 'update', '--recursive', '--init'],