Skip to content

Commit

Permalink
fixed composio login command
Browse files Browse the repository at this point in the history
  • Loading branch information
plxity committed Dec 13, 2024
1 parent aacaf1f commit a5cad64
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/src/sdk/utils/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export function setCliConfig(apiKey: string, baseUrl: string) {
userData.base_url = baseUrl;
}

saveFile(userDataPath(), userData);
saveFile(userDataPath(), JSON.stringify(userData));
}
2 changes: 1 addition & 1 deletion js/src/sdk/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ declare module "axios" {

// File path helpers
export const userDataPath = () =>
path.join(os.homedir(), LOCAL_CACHE_DIRECTORY_NAME, USER_DATA_FILE_NAME);
path.join(os.homedir(), LOCAL_CACHE_DIRECTORY_NAME, 'files', USER_DATA_FILE_NAME);
export const getUserDataJson = () => {
try {
const data = fs.readFileSync(userDataPath(), "utf8");
Expand Down
2 changes: 1 addition & 1 deletion js/src/sdk/utils/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getComposioFilesDir = () => {

export const saveFile = (file: string, content: string) => {
const composioFilesDir = getComposioFilesDir();
const filePath = `${composioFilesDir}/${file}`;
const filePath = path.join(composioFilesDir, path.basename(file));
fs.writeFileSync(filePath, content);

return filePath;
Expand Down

0 comments on commit a5cad64

Please sign in to comment.