Skip to content

Commit 86b2549

Browse files
author
Ali Abdelfattah
authored
Merge pull request #628 from Instabug/refactor/pkg-name-refs
[MOB-5991] Refactor package name references
2 parents 2e856e7 + 39ed5ae commit 86b2549

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'json'
22
package = JSON.parse(File.read('package.json'))
3-
version = JSON.parse(File.read('package.json'))["version"]
3+
version = package["version"]
44

55
Pod::Spec.new do |s|
6-
s.name = package["name"]
6+
s.name = 'RNInstabug'
77
s.version = version
88
s.summary = package["description"]
99
s.author = package["author"]

link.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
require 'json'
2+
package = JSON.parse(File.read('package.json'))
3+
14
#!/usr/bin/env ruby
25
begin
36
require 'xcodeproj'
47
rescue LoadError
5-
puts('xcodeproj gem doesn\'t exist. Please run \'gem install xcodeproj\' to install it, and re-run \'react-native link instabug-reactnative\' again')
8+
puts("xcodeproj gem doesn't exist. Please run \"gem install xcodeproj\" to install it, and re-run \"react-native link #{package["name"]}\" again")
69
Kernel.exit(0)
710
end
811

@@ -12,13 +15,13 @@
1215
file_name = File.basename(project_path, ".xcodeproj")
1316
project_location = "./ios/#{file_name}.xcodeproj"
1417
default_target_name = file_name
15-
framework_root = '../node_modules/instabug-reactnative/ios'
18+
framework_root = "../node_modules/#{package["name"]}/ios"
1619
framework_name = 'Instabug.xcframework'
1720

1821
INSTABUG_UPLOAD_NAME = "Upload Sourcemap"
1922

2023
INSTABUG_UPLOAD_SCRIPT = <<-SCRIPTEND
21-
bash "../node_modules/instabug-reactnative/ios/upload_sourcemap.sh"
24+
bash "../node_modules/#{package["name"]}/ios/upload_sourcemap.sh"
2225
SCRIPTEND
2326

2427
# Get useful variables

link_bridge.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const package = require('package.json');
12
const exec = require('child_process').exec;
23
require('./link_gradle');
3-
exec("ruby ./node_modules/instabug-reactnative/link.rb || echo \"Ruby doesn't exist, if you're building this for Android only, then feel free to ignore this error, otherwise please install Ruby and run 'react-native link instabug-reactnative' again\"");
4+
exec(`ruby ./node_modules/${package.name}/link.rb || echo \"Ruby doesn't exist, if you're building this for Android only, then feel free to ignore this error, otherwise please install Ruby and run 'react-native link ${package.name}' again\"`);

unlink.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
require 'json'
2+
package = JSON.parse(File.read('package.json'))
3+
14
#!/usr/bin/env ruby
25
begin
36
require 'xcodeproj'
@@ -11,7 +14,7 @@
1114
project_path = Dir.glob("#{current_path}/ios/*.xcodeproj").first
1215
file_name = File.basename(project_path, ".xcodeproj")
1316
project_location = "./ios/#{file_name}.xcodeproj"
14-
framework_root = '../node_modules/instabug-reactnative/ios'
17+
framework_root = "../node_modules/#{package["name"]}/ios"
1518
framework_name = 'Instabug.xcframework'
1619

1720
INSTABUG_UPLOAD_NAME = "Upload Sourcemap"

unlink_bridge.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const package = require('package.json');
12
const exec = require('child_process').exec;
23
require('./unlink_gradle');
3-
exec("ruby ./node_modules/instabug-reactnative/unlink.rb || echo \"Ruby doesn't exist, if you're building this for Android only, then feel free to ignore this error, otherwise please install Ruby and run 'react-native link instabug-reactnative' again\"");
4+
exec(`ruby ./node_modules/${package.name}/unlink.rb || echo \"Ruby doesn't exist, if you're building this for Android only, then feel free to ignore this error, otherwise please install Ruby and run 'react-native link ${package.name}' again\"`);

0 commit comments

Comments
 (0)