فهرست منبع

tweak(git): Check for 'ENOENT' instead of ErrorCodes.ENOENT

This is functionally the same, but removes one place where we
unnecessarily relied on Puter code.
Sam Atkins 11 ماه پیش
والد
کامیت
a68194090e
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      packages/git/src/subcommands/init.js

+ 1 - 2
packages/git/src/subcommands/init.js

@@ -18,7 +18,6 @@
  */
 import git from 'isomorphic-git';
 import path from 'path-browserify';
-import { ErrorCodes } from '@heyputer/puter-js-common/src/PosixError.js';
 
 export default {
     name: 'init',
@@ -65,7 +64,7 @@ export default {
             const stat = await fs.promises.stat(dot_git_path);
             repo_exists = true;
         } catch (e) {
-            if (e.posixCode === ErrorCodes.ENOENT) {
+            if (e.code === 'ENOENT') {
                 repo_exists = false;
             }
         }